/* ============================================================
   ds.css — Design System · Central de Chamados · Alfa CEM
   Versão 1.0 — Maio 2026

   HOW TO USE
   ──────────
   1. Adicione ANTES de qualquer CSS específico de página:
      <link rel="stylesheet" href="../css/ds.css">
   2. Use as classes e variáveis CSS deste arquivo.
   3. Sobrescreva apenas o que for realmente necessário por página.

   ÍNDICE
   ──────
   § 1  Tokens (variáveis CSS)
   § 2  Reset & Base
   § 3  Tipografia
   § 4  Hero (cabeçalho global)
   § 5  Botões
   § 6  Campos de formulário
   § 7  Cards
   § 8  Badges & Chips de status/prioridade
   § 9  Tabelas
   § 10 Modais
   § 11 Paginação
   § 12 Tabs
   § 13 Toast / Alertas
   § 14 Spinner & Skeleton
   § 15 Estado vazio
   § 16 Timeline
   § 17 Scrollbar customizada
   § 18 Animações
   § 19 Utilitários
   ============================================================ */


/* ============================================================
   § 1  TOKENS
   ============================================================ */
:root {
  /* — Paleta principal — */
  --ds-ink:      #0f2747;   /* texto principal */
  --ds-muted:    #5f7290;   /* texto secundário */
  --ds-bg:       #f4f7ff;   /* fundo da página */
  --ds-panel:    #ffffff;   /* fundo de cards e painéis */
  --ds-line:     #dbe7ff;   /* bordas e separadores */
  --ds-line-mid: #c7d8ff;   /* bordas de inputs */
  --ds-input-bg: #ffffff;   /* fundo de inputs */

  /* — Brand — */
  --ds-blue:     #1d4ed8;   /* azul primário */
  --ds-blue-dk:  #1e40af;   /* azul escuro (hover) */
  --ds-blue-lt:  #dbeafe;   /* azul claro (chips, hovers) */
  --ds-grad-a:   #0c4a6e;   /* gradiente hero início */
  --ds-grad-b:   #1d4ed8;   /* gradiente hero fim */

  /* — Semânticas — */
  --ds-success:  #10b981;
  --ds-success-lt:#dcfce7;
  --ds-success-dk:#15803d;
  --ds-danger:   #ef4444;
  --ds-danger-lt:#fee2e2;
  --ds-danger-dk:#b91c1c;
  --ds-warn:     #f59e0b;
  --ds-warn-lt:  #fef9c3;
  --ds-warn-dk:  #92400e;
  --ds-purple:   #8b5cf6;
  --ds-purple-lt:#f3e8ff;
  --ds-purple-dk:#6d28d9;
  --ds-orange:   #f97316;
  --ds-orange-lt:#ffedd5;
  --ds-orange-dk:#c2410c;

  /* — Status de chamado — */
  --ds-status-aberto-bg:       #dbeafe;
  --ds-status-aberto-fg:       #1d4ed8;
  --ds-status-andamento-bg:    #fef9c3;
  --ds-status-andamento-fg:    #92400e;
  --ds-status-aguardando-bg:   #f3e8ff;
  --ds-status-aguardando-fg:   #6d28d9;
  --ds-status-resolvido-bg:    #dcfce7;
  --ds-status-resolvido-fg:    #15803d;
  --ds-status-cancelado-bg:    #fee2e2;
  --ds-status-cancelado-fg:    #b91c1c;

  /* — Prioridade — */
  --ds-prio-baixa-bg:   #f1f5f9;
  --ds-prio-baixa-fg:   #475569;
  --ds-prio-media-bg:   #fef9c3;
  --ds-prio-media-fg:   #92400e;
  --ds-prio-alta-bg:    #ffedd5;
  --ds-prio-alta-fg:    #c2410c;
  --ds-prio-critica-bg: #fee2e2;
  --ds-prio-critica-fg: #b91c1c;

  /* — Sombras — */
  --ds-shadow-xs: 0 2px 6px rgba(16, 48, 98, .06);
  --ds-shadow-sm: 0 4px 14px rgba(16, 48, 98, .07);
  --ds-shadow-md: 0 8px 22px rgba(16, 48, 98, .10);
  --ds-shadow-lg: 0 14px 32px rgba(16, 48, 98, .12);
  --ds-shadow-xl: 0 32px 80px rgba(15, 39, 71, .22);

  /* — Raios de borda — */
  --ds-r-xs: 6px;
  --ds-r-sm: 8px;
  --ds-r-md: 10px;
  --ds-r-lg: 14px;
  --ds-r-xl: 16px;
  --ds-r-2xl:20px;
  --ds-r-pill:999px;

  /* — Tipografia — */
  --ds-font: "Poppins", Arial, sans-serif;

  /* — Transições — */
  --ds-ease: .15s ease;
}


/* ============================================================
   § 2  RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--ds-font);
  color: var(--ds-ink);
  background:
    radial-gradient(1100px 400px at 90% -8%,  rgba(37,99,235,.13), transparent 70%),
    radial-gradient(800px  360px at -8% 14%, rgba(12,74,110,.11), transparent 60%),
    var(--ds-bg);
  min-height: 100dvh;
}

/* Conteúdo principal centralizado */
.ds-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 20px 80px;
}
.ds-shell--narrow { max-width: 900px; }
.ds-shell--wide   { max-width: 1600px; }


/* ============================================================
   § 3  TIPOGRAFIA
   ============================================================ */
.ds-page-title {
  margin: 0 0 4px;
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 800;
  color: var(--ds-ink);
  letter-spacing: -.02em;
}
.ds-page-sub {
  margin: 0;
  font-size: 13px;
  color: var(--ds-muted);
  font-weight: 500;
}
.ds-section-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ds-ink);
}
.ds-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ds-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.ds-muted { color: var(--ds-muted); }


/* ============================================================
   § 4  HERO (cabeçalho global)
   ============================================================ */
.ds-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0a192f 0%, #003366 100%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .18);
  color: #fff;
}
.ds-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 88% 8%, rgba(255,255,255,.06) 0%, transparent 24%);
  pointer-events: none;
}

.ds-hero-inner {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 28px;
  min-height: 138px;
}
.ds-hero-logo {
  height: 80px;
  width: auto;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.22));
  flex-shrink: 0;
}
.ds-hero-body {
  flex: 1;
  min-width: 0;
}
.ds-hero-title {
  margin: 0 0 2px;
  font-size: clamp(15px, 2vw, 20px);
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.2;
  color: #fff;
}
.ds-hero-sub {
  margin: 0;
  font-size: 12px;
  color: rgba(255,255,255,.72);
  font-weight: 500;
}
.ds-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  padding: 4px 12px;
  border-radius: var(--ds-r-pill);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.ds-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}
.ds-hero-user {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ds-hero-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  border: 2px solid rgba(255,255,255,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}
.ds-hero-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ds-hero-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .ds-hero-inner { padding: 12px 16px; min-height: 80px; }
  .ds-hero-logo  { height: 44px; }
  .ds-hero-name  { display: none; }
}


/* ============================================================
   § 5  BOTÕES
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 18px;
  border: none;
  border-radius: var(--ds-r-md);
  font: 700 13px/1.2 var(--ds-font);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: filter var(--ds-ease), transform var(--ds-ease), box-shadow var(--ds-ease);
  position: relative;
  overflow: hidden;
}
.btn:disabled, .btn[disabled] {
  opacity: .5;
  pointer-events: none;
}
.btn:hover  { filter: brightness(1.07); transform: translateY(-1px); }
.btn:active { filter: brightness(.96);  transform: translateY(0); }

/* Variantes */
.btn-primary {
  background: linear-gradient(135deg, var(--ds-blue), #2563eb);
  color: #fff;
  box-shadow: 0 8px 18px rgba(29,78,216,.22);
}
.btn-secondary {
  background: #f1f5f9;
  color: var(--ds-ink);
  border: 1px solid var(--ds-line);
}
.btn-secondary:hover { background: #e8f0fe; }
.btn-ghost {
  background: transparent;
  color: var(--ds-blue);
  border: 1px solid var(--ds-line-mid);
}
.btn-ghost:hover { background: var(--ds-blue-lt); }
.btn-danger  { background: var(--ds-danger);  color: #fff; box-shadow: 0 8px 18px rgba(239,68,68,.2); }
.btn-success { background: var(--ds-success); color: #fff; box-shadow: 0 8px 18px rgba(16,185,129,.2); }
.btn-warn    { background: var(--ds-warn);    color: #fff; box-shadow: 0 8px 18px rgba(245,158,11,.2); }
.btn-outline {
  background: transparent;
  color: var(--ds-blue);
  border: 1.5px solid var(--ds-blue);
}
.btn-outline:hover { background: var(--ds-blue-lt); }

/* Tamanhos */
.btn-xs { height: 26px; padding: 0 10px; font-size: 11px; border-radius: var(--ds-r-sm); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; }
.btn-lg { height: 48px; padding: 0 26px; font-size: 15px; border-radius: var(--ds-r-lg); }
.btn-xl { height: 56px; padding: 0 32px; font-size: 16px; border-radius: var(--ds-r-lg); }
.btn-block { width: 100%; }

/* Ícone-only (quadrado) */
.btn-icon {
  width: 40px;
  padding: 0;
}
.btn-icon.btn-sm { width: 32px; }
.btn-icon.btn-xs { width: 26px; }

/* Estado carregando */
.btn.is-loading { pointer-events: none; opacity: .75; }
.btn.is-loading::after {
  content: "";
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: ds-spin .6s linear infinite;
  margin-left: 6px;
}


/* ============================================================
   § 6  CAMPOS DE FORMULÁRIO
   ============================================================ */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.field label,
.field .field-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ds-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1.5px solid var(--ds-line-mid);
  border-radius: var(--ds-r-md);
  font: 600 13px/1.2 var(--ds-font);
  color: var(--ds-ink);
  background: var(--ds-input-bg);
  outline: none;
  transition: border-color var(--ds-ease), box-shadow var(--ds-ease);
  appearance: none;
}
.field textarea {
  height: auto;
  min-height: 80px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.5;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--ds-blue);
  box-shadow: 0 0 0 3px rgba(29,78,216,.14);
}
.field input:hover,
.field select:hover {
  border-color: #93b4f5;
}
.field input::placeholder,
.field textarea::placeholder { color: #94a3b8; font-weight: 500; }
.field-hint { font-size: 11px; color: var(--ds-muted); margin-top: 2px; }
.field-error { font-size: 11px; color: var(--ds-danger); margin-top: 2px; font-weight: 600; }
.field input.is-error,
.field select.is-error { border-color: var(--ds-danger); box-shadow: 0 0 0 3px rgba(239,68,68,.12); }

/* Input com ícone */
.input-wrap { position: relative; }
.input-wrap input { padding-right: 40px; }
.input-wrap .input-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ds-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}
.input-wrap .input-icon-action { pointer-events: all; cursor: pointer; }
.input-wrap .input-icon-action:hover { color: var(--ds-blue); }

/* Toggle senha */
.toggle-password {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  background: transparent; border: 0;
  padding: 8px; cursor: pointer;
  color: #4b5563;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--ds-r-sm);
  transition: color var(--ds-ease);
}
.toggle-password:hover { color: var(--ds-blue); }
.toggle-password svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }

/* Checkbox / Radio customizados */
.ds-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--ds-ink);
  user-select: none;
}
.ds-check input[type="checkbox"],
.ds-check input[type="radio"] {
  width: 16px; height: 16px;
  accent-color: var(--ds-blue);
  margin: 0;
  flex-shrink: 0;
}

/* Form group (campos lado a lado) */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}


/* ============================================================
   § 7  CARDS
   ============================================================ */
.card {
  background: var(--ds-panel);
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-r-xl);
  padding: 20px;
  box-shadow: var(--ds-shadow-md);
  position: relative;
  overflow: hidden;
}
/* Faixa de acento no topo */
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ds-grad-a), var(--ds-grad-b));
}
/* Variante sem faixa */
.card.card-flat::before { display: none; }
/* Variante hover interativo */
.card.card-hover {
  cursor: pointer;
  transition: box-shadow var(--ds-ease), transform var(--ds-ease), border-color var(--ds-ease);
}
.card.card-hover:hover {
  box-shadow: var(--ds-shadow-lg);
  border-color: #bfd4ff;
  transform: translateY(-2px);
}
.card-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ds-ink);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

/* Info cell (dentro de cards de detalhe) */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.info-cell {
  background: #f8faff;
  border-radius: var(--ds-r-md);
  padding: 10px 12px;
}
.info-cell-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--ds-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 3px;
}
.info-cell-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--ds-ink);
}

/* KPI métrica compacta */
.metric-kpi {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 4px;
}
.metric-kpi-accent {
  width: 4px;
  border-radius: 4px;
  align-self: stretch;
  flex-shrink: 0;
}
.metric-kpi-body  { flex: 1; min-width: 0; }
.metric-kpi-value { font-size: 38px; font-weight: 800; line-height: 1; letter-spacing: -1px; }
.metric-kpi-unit  { font-size: 15px; font-weight: 700; color: #64748b; margin-left: 2px; }
.metric-kpi-label { font-size: 11px; font-weight: 600; color: var(--ds-muted); margin-top: 5px; text-transform: uppercase; letter-spacing: .04em; }
.metric-kpi-sub   { font-size: 10px; color: #94a3b8; margin-top: 2px; }
.metric-kpi-icon  { font-size: 30px; opacity: .5; flex-shrink: 0; }

/* Cores de acento KPI */
.acc-blue   { background: linear-gradient(180deg,#3b82f6,#1d4ed8); }
.acc-green  { background: linear-gradient(180deg,#10b981,#059669); }
.acc-red    { background: linear-gradient(180deg,#ef4444,#b91c1c); }
.acc-orange { background: linear-gradient(180deg,#f59e0b,#d97706); }
.acc-purple { background: linear-gradient(180deg,#8b5cf6,#6d28d9); }

/* Cores de valor KPI */
.val-blue   { color: #1d4ed8; }
.val-green  { color: #059669; }
.val-red    { color: #b91c1c; }
.val-orange { color: #d97706; }
.val-purple { color: #6d28d9; }

/* Delta chip comparativo */
.metric-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--ds-r-pill);
  margin-top: 6px;
}
.delta-up      { background: var(--ds-success-lt); color: var(--ds-success-dk); }
.delta-down    { background: var(--ds-danger-lt);  color: var(--ds-danger-dk);  }
.delta-neutral { background: #f1f5f9; color: #64748b; }
.delta-up.invert   { background: var(--ds-danger-lt);  color: var(--ds-danger-dk); }
.delta-down.invert { background: var(--ds-success-lt); color: var(--ds-success-dk); }


/* ============================================================
   § 8  BADGES & CHIPS
   ============================================================ */
/* Badge genérico */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--ds-r-pill);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* Status de chamado */
.badge-aberto       { background: var(--ds-status-aberto-bg);     color: var(--ds-status-aberto-fg);     }
.badge-em_andamento { background: var(--ds-status-andamento-bg);   color: var(--ds-status-andamento-fg);  }
.badge-aguardando   { background: var(--ds-status-aguardando-bg);  color: var(--ds-status-aguardando-fg); }
.badge-resolvido    { background: var(--ds-status-resolvido-bg);   color: var(--ds-status-resolvido-fg);  }
.badge-cancelado    { background: var(--ds-status-cancelado-bg);   color: var(--ds-status-cancelado-fg);  }

/* Prioridade */
.badge-baixa   { background: var(--ds-prio-baixa-bg);   color: var(--ds-prio-baixa-fg);   }
.badge-media   { background: var(--ds-prio-media-bg);   color: var(--ds-prio-media-fg);   }
.badge-alta    { background: var(--ds-prio-alta-bg);    color: var(--ds-prio-alta-fg);    }
.badge-critica { background: var(--ds-prio-critica-bg); color: var(--ds-prio-critica-fg); }

/* Badge semântico genérico */
.badge-success { background: var(--ds-success-lt); color: var(--ds-success-dk); }
.badge-danger  { background: var(--ds-danger-lt);  color: var(--ds-danger-dk);  }
.badge-warn    { background: var(--ds-warn-lt);    color: var(--ds-warn-dk);    }
.badge-info    { background: var(--ds-blue-lt);    color: var(--ds-blue-dk);    }
.badge-neutral { background: #f1f5f9; color: #475569; }

/* Chip de filtro ativo (com botão remover) */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ds-blue-lt);
  color: var(--ds-blue-dk);
  border: 1px solid #93c5fd;
  padding: 4px 4px 4px 10px;
  border-radius: var(--ds-r-pill);
  font-size: 11px;
  font-weight: 600;
  animation: ds-fadeIn .2s ease;
}
.filter-chip .fc-remove {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(30,64,175,.18);
  color: var(--ds-blue-dk);
  cursor: pointer; border: none; font-size: 11px;
  transition: background var(--ds-ease);
}
.filter-chip .fc-remove:hover { background: rgba(220,38,38,.22); color: var(--ds-danger-dk); }

/* Área badge */
.area-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ds-blue-lt);
  border: 1px solid #93c5fd;
  color: var(--ds-blue-dk);
  padding: 6px 12px;
  border-radius: var(--ds-r-sm);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}


/* ============================================================
   § 9  TABELAS
   ============================================================ */
.table-wrap { overflow-x: auto; }

.ds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ds-table thead th {
  background: #f1f5fe;
  color: var(--ds-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 11px;
  padding: 10px 12px;
  border-bottom: 2px solid var(--ds-line);
  text-align: left;
  white-space: nowrap;
}
.ds-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background var(--ds-ease);
}
.ds-table tbody tr:hover { background: #f7faff; }
.ds-table tbody tr:last-child { border-bottom: none; }
.ds-table td {
  padding: 9px 12px;
  color: var(--ds-ink);
  vertical-align: middle;
}

/* Tabela clicável (drill-down) */
.ds-table.drillable tbody tr {
  cursor: pointer;
}
.ds-table.drillable tbody tr:hover { background: #eff6ff; }
.ds-table.drillable tbody tr:hover td:first-child {
  color: var(--ds-blue);
  text-decoration: underline;
}

/* Tabela compacta */
.ds-table.compact thead th { padding: 7px 10px; }
.ds-table.compact td { padding: 6px 10px; font-size: 12px; }

/* Numeração de linha */
.ds-table .col-num { color: var(--ds-muted); font-size: 11px; font-weight: 700; width: 32px; }


/* ============================================================
   § 10  MODAIS
   ============================================================ */
.ds-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(15, 39, 71, .55);
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ds-overlay.open { display: flex; }

.ds-modal {
  background: var(--ds-panel);
  border-radius: var(--ds-r-2xl);
  width: min(720px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--ds-shadow-xl);
  animation: ds-modalIn .22s ease;
}
.ds-modal--sm { width: min(480px, 100%); }
.ds-modal--lg { width: min(960px, 100%); }

.ds-modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e8eeff;
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.ds-modal-header .mh-main    { flex: 1; min-width: 0; }
.ds-modal-header .mh-title   { font-size: 16px; font-weight: 800; color: var(--ds-ink); line-height: 1.3; margin: 0; }
.ds-modal-header .mh-sub     { font-size: 12px; color: var(--ds-muted); margin: 4px 0 0; }

.ds-modal-body {
  overflow-y: auto;
  padding: 20px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.ds-modal-footer {
  padding: 14px 24px 20px;
  border-top: 1px solid #e8eeff;
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Botão fechar modal */
.ds-modal-close {
  width: 32px; height: 32px;
  border-radius: var(--ds-r-sm);
  border: 1px solid #e8eeff;
  background: #f8faff;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--ds-muted);
  transition: background var(--ds-ease), color var(--ds-ease);
}
.ds-modal-close:hover {
  background: var(--ds-danger-lt);
  border-color: #fca5a5;
  color: var(--ds-danger-dk);
}

/* Seção dentro do modal */
.modal-section-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ds-muted);
  margin: 0 0 10px;
}


/* ============================================================
   § 11  PAGINAÇÃO
   ============================================================ */
.ds-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--ds-line);
  flex-wrap: wrap;
}
.ds-pag-info {
  font-size: 12px;
  color: var(--ds-muted);
  font-weight: 600;
}
.ds-pag-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ds-pag-btn {
  min-width: 34px; height: 34px;
  padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--ds-line-mid);
  border-radius: var(--ds-r-sm);
  background: var(--ds-panel);
  font: 600 12px var(--ds-font);
  color: var(--ds-ink);
  cursor: pointer;
  transition: background var(--ds-ease), border-color var(--ds-ease), color var(--ds-ease);
  text-decoration: none;
}
.ds-pag-btn:hover { background: var(--ds-blue-lt); border-color: #93c5fd; color: var(--ds-blue); }
.ds-pag-btn.active { background: var(--ds-blue); color: #fff; border-color: var(--ds-blue); }
.ds-pag-btn:disabled, .ds-pag-btn.disabled { opacity: .4; pointer-events: none; }


/* ============================================================
   § 12  TABS
   ============================================================ */
.ds-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--ds-line);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.ds-tab {
  padding: 8px 14px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  font: 600 13px var(--ds-font);
  color: var(--ds-muted);
  cursor: pointer;
  margin-bottom: -2px;
  transition: color var(--ds-ease), border-color var(--ds-ease);
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.ds-tab:hover { color: var(--ds-blue); }
.ds-tab.active { color: var(--ds-blue); border-bottom-color: var(--ds-blue); font-weight: 700; }

/* Tabs compactas (tipo pill) */
.ds-tabs.pill { border-bottom: none; gap: 4px; margin-bottom: 12px; }
.ds-tabs.pill .ds-tab {
  border: 1px solid transparent;
  border-radius: var(--ds-r-sm);
  padding: 6px 12px;
  background: #f1f5f9;
  border-bottom: 1px solid transparent;
  margin-bottom: 0;
}
.ds-tabs.pill .ds-tab:hover   { background: #e0e7ff; color: var(--ds-blue); }
.ds-tabs.pill .ds-tab.active  { background: var(--ds-blue); color: #fff; border-color: var(--ds-blue-dk); }


/* ============================================================
   § 13  TOAST / ALERTAS
   ============================================================ */
/* Container de toasts */
#ds-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.ds-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 280px;
  max-width: 380px;
  background: var(--ds-panel);
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-r-lg);
  padding: 12px 14px;
  box-shadow: var(--ds-shadow-lg);
  animation: ds-toastIn .3s ease;
  pointer-events: all;
}
.ds-toast.removing { animation: ds-toastOut .25s ease forwards; }
.ds-toast-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.ds-toast-body { flex: 1; min-width: 0; }
.ds-toast-title { font-size: 13px; font-weight: 700; color: var(--ds-ink); }
.ds-toast-msg   { font-size: 12px; color: var(--ds-muted); margin-top: 2px; }
.ds-toast-close { font-size: 14px; cursor: pointer; color: var(--ds-muted); background: none; border: none; line-height: 1; padding: 0; flex-shrink: 0; }
.ds-toast-close:hover { color: var(--ds-danger); }

.ds-toast.success { border-left: 3px solid var(--ds-success); }
.ds-toast.danger  { border-left: 3px solid var(--ds-danger);  }
.ds-toast.warn    { border-left: 3px solid var(--ds-warn);    }
.ds-toast.info    { border-left: 3px solid var(--ds-blue);    }

/* Alertas inline */
.ds-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--ds-r-md);
  font-size: 13px;
  border: 1px solid transparent;
}
.ds-alert-icon  { font-size: 16px; flex-shrink: 0; }
.ds-alert-body  { flex: 1; line-height: 1.5; }
.ds-alert.success { background: var(--ds-success-lt); color: var(--ds-success-dk); border-color: #a7f3d0; }
.ds-alert.danger  { background: var(--ds-danger-lt);  color: var(--ds-danger-dk);  border-color: #fca5a5; }
.ds-alert.warn    { background: var(--ds-warn-lt);    color: var(--ds-warn-dk);    border-color: #fde68a; }
.ds-alert.info    { background: var(--ds-blue-lt);    color: var(--ds-blue-dk);    border-color: #93c5fd; }


/* ============================================================
   § 14  SPINNER & SKELETON
   ============================================================ */
.ds-spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2.5px solid var(--ds-line-mid);
  border-top-color: var(--ds-blue);
  border-radius: 50%;
  animation: ds-spin .6s linear infinite;
  vertical-align: middle;
  flex-shrink: 0;
}
.ds-spinner.sm { width: 14px; height: 14px; border-width: 2px; }
.ds-spinner.lg { width: 32px; height: 32px; border-width: 3px; }

/* Full-page loading */
.ds-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(244,247,255,.8);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}
.ds-loading-overlay .ds-spinner { width: 40px; height: 40px; border-width: 3px; }
.ds-loading-overlay p { font-size: 13px; color: var(--ds-muted); font-weight: 600; margin: 0; }

/* Skeleton shimmer */
@keyframes ds-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}
.ds-skeleton {
  border-radius: var(--ds-r-sm);
  background: linear-gradient(90deg, #eef2ff 0%, #f8faff 45%, #eef2ff 100%);
  background-size: 1200px 100%;
  animation: ds-shimmer 1.5s linear infinite;
  display: block;
}
.ds-skeleton-text  { height: 14px; width: 80%; margin-bottom: 8px; }
.ds-skeleton-title { height: 22px; width: 55%; margin-bottom: 10px; }
.ds-skeleton-rect  { height: 80px; width: 100%; }


/* ============================================================
   § 15  ESTADO VAZIO
   ============================================================ */
.ds-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ds-muted);
}
.ds-empty-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 10px;
  opacity: .7;
}
.ds-empty-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ds-ink);
  margin: 0 0 4px;
}
.ds-empty-sub {
  font-size: 13px;
  color: var(--ds-muted);
  margin: 0 0 16px;
}

/* Drop zone */
.ds-drop-zone {
  border: 2px dashed var(--ds-line-mid);
  border-radius: var(--ds-r-lg);
  padding: 40px 24px;
  text-align: center;
  color: var(--ds-muted);
  font-size: 13px;
  transition: border-color var(--ds-ease), background var(--ds-ease);
}
.ds-drop-zone:hover, .ds-drop-zone.drag-over {
  border-color: var(--ds-blue);
  background: var(--ds-blue-lt);
}


/* ============================================================
   § 16  TIMELINE (histórico de chamados)
   ============================================================ */
.ds-timeline { display: flex; flex-direction: column; }
.ds-tl-item {
  display: flex;
  gap: 12px;
  position: relative;
  padding-bottom: 18px;
}
.ds-tl-item:last-child { padding-bottom: 0; }
.ds-tl-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 11px; top: 24px; bottom: 0;
  width: 2px;
  background: #e2e8f0;
}
.ds-tl-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: #fff;
}
.tl-aberto      { background: #3b82f6; }
.tl-em_andamento{ background: #f59e0b; }
.tl-aguardando  { background: #8b5cf6; }
.tl-resolvido   { background: #10b981; }
.tl-cancelado   { background: #ef4444; }
.tl-mensagem    { background: #64748b; }

.ds-tl-content { flex: 1; min-width: 0; }
.ds-tl-status  { font-size: 13px; font-weight: 700; color: var(--ds-ink); }
.ds-tl-meta    { font-size: 11px; color: var(--ds-muted); margin-top: 2px; }
.ds-tl-obs {
  font-size: 11px; color: #475569;
  margin-top: 4px;
  background: #f8faff;
  border-radius: var(--ds-r-xs);
  padding: 5px 8px;
  line-height: 1.5;
}

/* Estrelas de avaliação */
.ds-stars { display: flex; gap: 3px; font-size: 18px; }
.ds-star-filled { color: var(--ds-warn); }
.ds-star-empty  { color: #e2e8f0; }


/* ============================================================
   § 17  SCROLLBAR CUSTOMIZADA
   ============================================================ */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ds-line-mid); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #93b4f5; }


/* ============================================================
   § 18  ANIMAÇÕES
   ============================================================ */
@keyframes ds-fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@keyframes ds-spin {
  to { transform: rotate(360deg); }
}
@keyframes ds-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .45; }
}
@keyframes ds-modalIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
@keyframes ds-toastIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: none; }
}
@keyframes ds-toastOut {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateX(24px); }
}
@keyframes ds-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

/* Classes de animação utilitárias */
.ds-fade-in { animation: ds-fadeIn .25s ease; }


/* ============================================================
   § 19  UTILITÁRIOS
   ============================================================ */

/* — Flexbox — */
.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap    { flex-wrap: wrap; }
.items-center { align-items: center; }
.gap-4  { gap: 4px;  }
.gap-6  { gap: 6px;  }
.gap-8  { gap: 8px;  }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }

/* — Grid — */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }

/* — Texto — */
.text-xs   { font-size: 11px; }
.text-sm   { font-size: 12px; }
.text-base { font-size: 13px; }
.text-md   { font-size: 15px; }
.text-lg   { font-size: 18px; }
.text-center { text-align: center; }
.text-right  { text-align: right;  }
.font-bold   { font-weight: 700; }
.font-semibold { font-weight: 600; }
.truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* — Espaçamento — */
.mt-4  { margin-top:  4px;  } .mb-4  { margin-bottom:  4px;  }
.mt-8  { margin-top:  8px;  } .mb-8  { margin-bottom:  8px;  }
.mt-12 { margin-top: 12px;  } .mb-12 { margin-bottom: 12px;  }
.mt-16 { margin-top: 16px;  } .mb-16 { margin-bottom: 16px;  }
.mt-24 { margin-top: 24px;  } .mb-24 { margin-bottom: 24px;  }
.p-0   { padding: 0; }
.w-full { width: 100%; }

/* — Visibility — */
.hidden     { display: none !important; }
.invisible  { visibility: hidden; }
.sr-only    { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* — Cores de texto utilitárias — */
.text-success { color: var(--ds-success-dk); }
.text-danger  { color: var(--ds-danger-dk);  }
.text-warn    { color: var(--ds-warn-dk);    }
.text-blue    { color: var(--ds-blue);       }
.text-muted   { color: var(--ds-muted);      }
.text-ink     { color: var(--ds-ink);        }

/* — Divisor — */
.ds-divider {
  border: none;
  border-top: 1px solid var(--ds-line);
  margin: 16px 0;
}

/* — Link — */
.ds-link {
  color: var(--ds-blue);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--ds-ease);
}
.ds-link:hover { color: var(--ds-blue-dk); text-decoration: underline; }

/* — Responsive helpers — */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hide-mobile { display: none !important; }
  .ds-shell    { padding: 14px 12px 60px; }
}
@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}


/* ============================================================
   § 20  DEV CREDIT  (Desenvolvido por TI <JJT/>)
   Componente reutilizável em todas as páginas.
   Uso: <footer class="dev-footer"><div class="dev-footer-inner">…</div></footer>
   ============================================================ */
.dev-footer {
  display: flex;
  justify-content: center;
  padding: 0 0 22px;
}
.dev-footer-inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.75);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 7px 13px;
  backdrop-filter: blur(6px);
}
.dev-footer-avatar {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: linear-gradient(135deg, #c0392b, #e74c3c);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.dev-footer-text  { display: flex; flex-direction: column; gap: 2px; }
.dev-footer-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700;
  color: var(--ds-ink); line-height: 1;
}
.dev-footer-tag {
  font-size: 9px; font-weight: 800;
  font-family: 'Courier New', monospace;
  background: linear-gradient(135deg, #0d9488, #0891b2);
  color: #fff;
  padding: 2px 6px; border-radius: 4px;
}
.dev-footer-email { font-size: 10px; color: var(--ds-muted); }

/* Variante escura — para usar sobre fundos dark (ex: painel de marca do login) */
.dev-footer-inner.dark {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.14);
}
.dev-footer-inner.dark .dev-footer-title { color: rgba(255,255,255,.9); }
.dev-footer-inner.dark .dev-footer-email { color: rgba(255,255,255,.45); }
