/* ═════════════════════════════════════════════════════════════════════
   DESIGN SYSTEM — GESTOR DE TAREFAS v2.0
   Vivian Coser Arquitetos Associados
   ═════════════════════════════════════════════════════════════════════
   Fonte única de verdade para todos os tokens.
   NENHUM outro arquivo deve definir :root ou --var custom.
   ═════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {

  /* ─── Layout ─── */
  --paper:            #FAF9F5;
  --surface:          #FFFFFF;
  --surface-hover:    #F7F6F2;
  --border-light:     #E8E7E3;
  --border:           #D4D3CF;
  --border-input:     #D4D3CF;
  --line-strong:      #B0AFAB;

  /* ─── Typography ─── */
  --font-display:     'Space Grotesk', sans-serif;
  --font-body:        'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:        'IBM Plex Mono', 'SF Mono', 'Fira Code', monospace;

  --text:             #1C1B1A;
  --text-secondary:   #5C5B57;
  --text-muted:       #9C9B97;

  /* ─── Brand / Ação ─── */
  --brand:            #1F4D3F;      /* verde escuro — spec aprovado */
  --brand-hover:      #183E32;
  --brand-light:      #4A7D6B;
  --brand-soft:       #D6E8E2;
  --brand-ghost:      rgba(31,77,63,0.06);

  /* ─── Semântica ─── */
  --teal:             #2F6E5B;      /* concluído / success — spec */
  --teal-soft:        #DAEAE4;
  --amber:            #B8763A;      /* em andamento / warning — spec */
  --amber-soft:       #F3E5D7;
  --red:              #B4423A;      /* atrasado / danger — spec */
  --red-soft:         #F0D9D8;
  --slate:            #4A5568;      /* não iniciado / neutro — spec */
  --slate-soft:       #E8EBEF;
  --violet:           #6B4E8E;      /* revisão / pendente — spec */
  --violet-soft:      #E5DEEE;
  --indigo:           #3B5BA5;      /* link / destaque — spec */
  --indigo-soft:      #DCE3F2;
  --rose:             #A8496B;      /* cancelado / urgente — spec */
  --rose-soft:        #F0DBE4;

  /* ─── Shadows ─── */
  --shadow-sm:        0 1px 2px rgba(0,0,0,0.04);
  --shadow:           0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:        0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:        0 10px 15px rgba(0,0,0,0.06), 0 4px 6px rgba(0,0,0,0.04);
  --shadow-card:      0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);

  /* ─── Radii ─── */
  --radius-sm:        6px;
  --radius:           12px;
  --radius-lg:        16px;
  --radius-full:      9999px;

  /* ─── Transitions ─── */
  --transition-fast:  150ms ease;
  --transition:       200ms ease;

  /* ═══ ALIASES (compatibilidade reversa) ═══ */
  --bg:               var(--paper);
  --success:          var(--teal);
  --success-soft:     var(--teal-soft);
  --warning:          var(--amber);
  --warning-soft:     var(--amber-soft);
  --danger:           var(--red);
  --danger-soft:      var(--red-soft);
  --accent:           var(--brand);

  /* ═══ ALIASES clientes/fornecedores (migração) ═══ */
  --card:             var(--surface);
  --ink:              var(--text);
  --ink-soft:         var(--text-secondary);
  --ink-faint:        var(--text-muted);
  --line:             var(--border-light);
  --line-strong:      var(--border);

  /* ═══ ALIASES style.css (migração v1 → v2) ═══ */
  --vc-green:         var(--brand);
  --vc-green-dark:    var(--brand-hover);
  --vc-green-light:   var(--brand-light);
  --vc-green-soft:    var(--brand-soft);
  --vc-green-ghost:   #F3F7F6;
  --vc-gold:          var(--amber);
  --vc-gold-light:    var(--amber-soft);
  --primary:          var(--brand);
  --primary-hover:    var(--brand-hover);
  --danger-hover:     #8B322C;
  --radius-xs:        var(--radius-sm);

  /* ═══ ALIASES fornecedores.css ═══ */
  --teal-line:        #BFDACE;
  --amber-line:       #E7CBA2;
  --radius-card:      var(--radius);
}

/* ─── RESET BASE ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── UTILITIES ─── */
.font-display { font-family: var(--font-display); }
.font-body    { font-family: var(--font-body); }
.font-mono    { font-family: var(--font-mono); }

/* ─── componentes padrão: botão primário ─── */
.ds-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.ds-btn-primary {
  background: var(--brand);
  color: #fff;
}
.ds-btn-primary:hover {
  background: var(--brand-hover);
}

.ds-btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.ds-btn-secondary:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.ds-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.ds-btn-ghost:hover {
  background: var(--brand-ghost);
  color: var(--brand);
}

/* ─── Badge pill (design system padrão) ─── */
.ds-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  gap: 0.25rem;
  line-height: 1.4;
}

.ds-badge-teal    { background: var(--teal-soft);  color: var(--teal); }
.ds-badge-amber   { background: var(--amber-soft); color: var(--amber); }
.ds-badge-red     { background: var(--red-soft);   color: var(--red); }
.ds-badge-slate   { background: var(--slate-soft); color: var(--slate); }
.ds-badge-violet  { background: var(--violet-soft);color: var(--violet); }
.ds-badge-indigo  { background: var(--indigo-soft);color: var(--indigo); }
.ds-badge-rose    { background: var(--rose-soft);  color: var(--rose); }
.ds-badge-brand   { background: var(--brand-soft); color: var(--brand); }

/* ─── KPI card padrão ─── */
.ds-kpi {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.ds-kpi .kpi-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ds-kpi .kpi-value {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.ds-kpi .kpi-trend {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ─── Header de página ─── */
.ds-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.ds-page-header h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.ds-page-header .header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ─── Tabela padrão ─── */
.ds-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.ds-table {
  width: 100%;
  border-collapse: collapse;
}
.ds-table 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;
}
.ds-table td {
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.ds-table tr:last-child td {
  border-bottom: none;
}
.ds-table tr:hover td {
  background: var(--surface-hover);
}
.ds-table .mono {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* ─── Paginação ─── */
.ds-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.85rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.ds-pagination .page-btns {
  display: flex;
  gap: 0.2rem;
}
.ds-pagination .page-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.ds-pagination .page-btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}
.ds-pagination .page-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ─── Search box ─── */
.ds-search {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}
.ds-search 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;
  transition: border-color var(--transition-fast);
}
.ds-search input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31,77,63,0.08);
}
.ds-search input::placeholder {
  color: var(--text-muted);
}
.ds-search .search-icon {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  pointer-events: none;
  opacity: 0.5;
}

/* ─── Empty state ─── */
.ds-empty {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
}
.ds-empty .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.4;
}
.ds-empty p {
  font-size: 0.9rem;
}

/* ─── SEGMENTED CONTROL ─── */
.ds-segmented {
  display: inline-flex;
  gap: 0.25rem;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.2rem;
}
.ds-segmented button {
  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;
}
.ds-segmented button:hover {
  color: var(--text);
  background: var(--surface-hover);
}
.ds-segmented button.active {
  background: var(--text);
  color: #fff;
}

/* ─── STATUS MAP (pill badges por status) ─── */
.ds-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.4;
}

/* Cores ajustadas ao spec aprovado */
.ds-status-em-andamento { background: var(--amber-soft); color: #8B5E34; }
.ds-status-concluida    { background: var(--teal-soft);  color: #1F4D3F; }
.ds-status-atrasado     { background: var(--red-soft);   color: #8B322C; }
.ds-status-nao-iniciado { background: var(--slate-soft); color: #3A4455; }
.ds-status-pendente     { background: var(--violet-soft);color: #4F376A; }
.ds-status-cancelado    { background: var(--rose-soft);  color: #803750; }
.ds-status-planejada    { background: var(--indigo-soft);color: #2B457D; }

/* ─── STAT CARDS (Gestão de Horas) ─── */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 900px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .stat-cards { grid-template-columns: 1fr; }
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}
.stat-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
  transform: translateY(-2px);
}
.stat-card-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.stat-card-value {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  font-family: var(--font-mono);
}

/* ─── DS LINK ─── */
.ds-link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition-fast);
}
.ds-link:hover {
  color: var(--brand-hover);
  text-decoration: underline;
}

/* ══════
   LAYOUT — SIDEBAR + TOPBAR
   ══════ */
