/* ═════════════════════════════════════════════════════════════════════
   DS-OVERRIDES — Sobrescreve classes legadas com tokens do DS
   Vem DEPOIS do style.css na ordem de importação.
   ═════════════════════════════════════════════════════════════════════ */

/* ─── PAGE HEADER (Projetos, Diretrizes, etc) ─── */
.view .page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.view .page-header h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text);
  letter-spacing: -0.02em;
  margin: 0;
}

/* ─── VIEW TOGGLE ─── */
.view .view-toggle {
  display: inline-flex;
  gap: 0.25rem;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.2rem;
}
.view .view-toggle .view-btn {
  padding: 0.3rem 0.75rem;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.view .view-toggle .view-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}
.view .view-toggle .view-btn.active {
  background: var(--text);
  color: #fff;
}
.view .view-toggle .view-icon {
  font-size: 0.75rem;
  margin-right: 0.2rem;
}

/* ─── BOTÕES ─── */
.view .btn-primary,
.view .btn.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.view .btn-primary:hover {
  background: var(--brand-hover);
}
.view .btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-body);
}

/* ─── SEARCH BOX ─── */
.view .search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}
.view .search-box input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--transition-fast);
}
.view .search-box input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(42,157,143,0.08);
}

/* ─── FORM INPUT (select, input) ─── */
.view .form-input {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--transition-fast);
}
.view .form-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(42,157,143,0.08);
}

/* ─── TABLE ─── */
.view .table-container {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.view .table-container table {
  width: 100%;
  border-collapse: collapse;
}
.view .table-container th {
  text-align: left;
  padding: 0.6rem 0.85rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--paper);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
.view .table-container td {
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.view .table-container tr:last-child td {
  border-bottom: none;
}
.view .table-container tr:hover td {
  background: var(--surface-hover);
}

/* ─── EMPTY STATE ─── */
.view .empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
}
.view .empty-state p {
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* ═══ MODAIS — garantir fundo opaco mesmo dentro de .view ═══ */
.view .modal-content,
.view .modal-card,
.view .modal-header,
.view .modal-body,
.view .modal-footer,
#modal-overlay .modal-content,
.modal-overlay .modal-content {
  background: var(--surface) !important;
}
.view .modal-backdrop,
.modal-backdrop {
  background: rgba(0,0,0,0.4) !important;
}

/* ─── KANBAN ─── */
.view .kanban-scroll-wrapper {
  overflow-x: auto;
  padding-bottom: 0.5rem;
}
.view .kanban-container {
  display: flex;
  gap: 16px;
  padding: 0 0 8px;
  min-height: 300px;
}
.view .kanban-column {
  min-width: 260px;
  max-width: 320px;
  flex: 1;
  background: var(--paper);
  border-radius: var(--radius);
  padding: 12px;
  border: 1px solid var(--border-light);
}
.view .kanban-column h3 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-light);
}

/* ─── CARD DE PROJETO (Kanban) ─── */
.view .projeto-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: box-shadow var(--transition-fast);
}
.view .projeto-card:hover {
  box-shadow: var(--shadow-md);
}
.view .projeto-card .projeto-nome {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 4px;
}
.view .projeto-card .projeto-cliente {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* ─── LOADING ─── */
.view .table-loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ─── LISTA DE PROJETOS (na tabela) ─── */
.view .lista-filtros-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════════
   VIEW: DIRETRIZES VCS
   ══════════════════════════════════════════════════════════ */

#view-diretrizes-vcs .view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
#view-diretrizes-vcs .view-header-titulo h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
#view-diretrizes-vcs .view-header .view-icon {
  display: none; /* remove emoji, usa icone de marca */
}
#view-diretrizes-vcs .view-header h2::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--brand);
  border-radius: 3px;
  margin-right: 4px;
}
#view-diretrizes-vcs .view-subtitulo {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
#view-diretrizes-vcs .view-header-acoes {
  display: flex;
  gap: 0.5rem;
}
#view-diretrizes-vcs .btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition-fast);
}
#view-diretrizes-vcs .btn-outline:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

/* Toolbar */
#view-diretrizes-vcs .diretrizes-toolbar {
  margin-bottom: 1.25rem;
}
#view-diretrizes-vcs .filtro-grupo {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
#view-diretrizes-vcs .filtro-grupo select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--font-body);
  outline: none;
}
#view-diretrizes-vcs .busca-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}
#view-diretrizes-vcs .busca-wrapper input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2rem;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--font-body);
  outline: none;
}
#view-diretrizes-vcs .busca-wrapper input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(42,157,143,0.08);
}
#view-diretrizes-vcs .busca-icone {
  position: absolute;
  left: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.4;
  pointer-events: none;
}

/* Abas */
#view-diretrizes-vcs .diretrizes-abas {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.2rem;
  overflow-x: auto;
}
#view-diretrizes-vcs .diretrizes-abas button {
  padding: 0.35rem 0.85rem;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
#view-diretrizes-vcs .diretrizes-abas button:hover {
  background: var(--surface-hover);
  color: var(--text);
}
#view-diretrizes-vcs .diretrizes-abas button.ativa {
  background: var(--text);
  color: #fff;
}

/* Grid de diretrizes */
#view-diretrizes-vcs .diretrizes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
#view-diretrizes-vcs .diretriz-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-fast);
}
#view-diretrizes-vcs .diretriz-card:hover {
  box-shadow: var(--shadow-md);
}
#view-diretrizes-vcs .diretriz-card h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 4px;
}
#view-diretrizes-vcs .diretriz-card .diretriz-descricao {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
#view-diretrizes-vcs .diretriz-card .diretriz-obrigatorio {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.65rem;
  font-weight: 600;
  background: var(--red-soft);
  color: var(--red);
}
#view-diretrizes-vcs .diretriz-card .diretriz-categoria {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.65rem;
  font-weight: 500;
  background: var(--slate-soft);
  color: var(--slate);
}
#view-diretrizes-vcs .diretriz-contagem {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════════
   VIEW: MINHAS TAREFAS
   ══════════════════════════════════════════════════════════ */

#view-minhas-tarefas .view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
#view-minhas-tarefas .view-header h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* ══════════════════════════════════════════════════════════
   VIEW: TEMPLATES
   ══════════════════════════════════════════════════════════ */

#view-templates .view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
#view-templates .view-header h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* ══════════════════════════════════════════════════════════
   VIEW: TIMESHEET
   ══════════════════════════════════════════════════════════ */

#view-timesheet .view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
#view-timesheet .view-header h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* ══════════════════════════════════════════════════════════
   VIEW: CADASTRO DE PROJETOS
   ══════════════════════════════════════════════════════════ */

#view-cadastro-projetos .view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
#view-cadastro-projetos .view-header h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* ══════════════════════════════════════════════════════════
   VIEW: DASHBOARD SEMANAL
   ══════════════════════════════════════════════════════════ */

#view-dashboard-semanal .view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
#view-dashboard-semanal .view-header h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* ══════════════════════════════════════════════════════════
   VIEW: GESTAO DE HORAS
   ══════════════════════════════════════════════════════════ */

#view-gestao-horas .view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
#view-gestao-horas .view-header h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* ══════════════════════════════════════════════════════════
   VIEW: CONTAS DE ACESSO
   ══════════════════════════════════════════════════════════ */

#view-contas-acesso .view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
#view-contas-acesso .view-header h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* ══════════════════════════════════════════════════════════
   VIEW: RELATORIOS
   ══════════════════════════════════════════════════════════ */

#view-relatorios .view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
#view-relatorios .view-header h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* ══════════════════════════════════════════════════════════
   VIEW: VISAO GERENCIAL
   ══════════════════════════════════════════════════════════ */

#view-visao-gerencial .view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
#view-visao-gerencial .view-header h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* ══════════════════════════════════════════════════════════
   GLOBAL — Força fundo paper + fontes em QUALQUER view
   ══════════════════════════════════════════════════════════ */
section.view, div.view, .view {
  background: var(--paper);
  font-family: var(--font-body);
  color: var(--text);
  min-height: auto;
}
.view h1, .view h2, .view h3,
.view .page-header h1, .view .page-header h2,
.view .view-header h1, .view .view-header h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.view .mono,
.view .dados-mono,
.view .valor-mono,
.view .contagem-mono {
  font-family: var(--font-mono);
}
.view table th {
  font-family: var(--font-body);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
}
.view .empty-state,
.view .table-loading {
  color: var(--text-muted);
}

/* ─── Subtarefas na Gestão de Tarefas (linhas aninhadas) ─── */
.gt-caret {
    display: inline-block;
    width: 14px;
    margin-right: 4px;
    font-size: 9px;
    color: var(--text-muted, #9C9B97);
    cursor: pointer;
    transition: color .15s;
    user-select: none;
}
.gt-caret:hover { color: var(--brand, #1F4D3F); }
.gt-caret-open { color: var(--brand, #1F4D3F); }
.gt-sub-badge {
    display: inline-block;
    margin-left: 8px;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 20px;
    background: var(--brand-ghost, rgba(31,77,63,.06));
    color: var(--brand-light, #4A7D6B);
    vertical-align: middle;
}
tr.gt-subrow { background: var(--surface-hover, #F7F6F2); }
tr.gt-subrow:hover { background: var(--brand-ghost, rgba(31,77,63,.06)); }
tr.gt-subrow td { border-top: none; }
td.gt-subtitle { padding-left: 26px; }
.gt-sub-elbow {
    color: var(--text-muted, #9C9B97);
    margin-right: 6px;
    font-size: 13px;
}
.gt-subadd {
    background: none;
    border: 1px dashed var(--border-2, #D4D3CF);
    border-radius: 6px;
    color: var(--text-secondary, #5C5B57);
    font-size: 12px;
    padding: 4px 12px;
    margin-left: 26px;
    cursor: pointer;
}
.gt-subadd:hover {
    border-color: var(--brand-light, #4A7D6B);
    color: var(--brand, #1F4D3F);
}
.gt-subadd-input {
    margin-left: 26px;
    width: 260px;
    max-width: 60%;
    font-size: 13px;
    padding: 5px 10px;
    border: 1px solid var(--brand-light, #4A7D6B);
    border-radius: 6px;
    background: var(--surface, #fff);
    color: var(--text, #1C1B1A);
    outline: none;
}
.gt-subadd-input:focus { box-shadow: 0 0 0 2px var(--brand-soft, #D6E8E2); }

/* ─── Botão secundário da Gestão de Tarefas (Exportar HTML) ─── */
#view-gestao-tarefas .gt-btn-secondary {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--surface, #fff); color: var(--brand, #1F4D3F);
    border: 1px solid var(--border-2, #D4D3CF);
    padding: 10px 16px; border-radius: 8px;
    font-family: 'Inter', sans-serif; font-weight: 600; font-size: 13.5px;
    cursor: pointer; white-space: nowrap; transition: all .15s ease;
}
#view-gestao-tarefas .gt-btn-secondary:hover {
    border-color: var(--brand-light, #4A7D6B);
    background: var(--brand-ghost, rgba(31,77,63,.06));
}
#view-gestao-tarefas .gt-btn-secondary svg { stroke: var(--brand, #1F4D3F); }
