/* ============================================================
   ContractHub — Design System v6  (midnight zinc + índigo)
   ============================================================ */

:root {
  /* Cores base — midnight zinc */
  --bg:        #08080c;
  --surface:   #0e0e14;
  --surface-2: #131320;
  --border:    #1e1e2e;
  --border-2:  #282840;
  --text:      #e2e2f0;
  --muted:     #6b6b8f;
  --muted-2:   #3a3a55;

  /* Cores de acento — índigo elétrico */
  --primary:      #6366f1;
  --primary-mid:  #818cf8;
  --primary-glow: rgba(129,140,248,.18);
  --green:        #34d399;
  --green-glow:   rgba(52,211,153,.16);
  --orange:       #fb923c;
  --orange-glow:  rgba(251,146,60,.15);
  --purple:       #c084fc;
  --purple-glow:  rgba(192,132,252,.15);
  --red:          #f87171;
  --red-glow:     rgba(248,113,113,.15);

  /* Layout */
  --sidebar-w: 228px;
  --radius:    10px;
  --radius-sm: 6px;
  --radius-lg: 14px;

  /* Sombras */
  --shadow-sm: 0 1px 4px rgba(0,0,0,.40);
  --shadow-md: 0 4px 16px rgba(0,0,0,.55);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.65);

  /* Animações */
  --transition: .18s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scrollbar-color: var(--border-2) var(--bg); scrollbar-width: thin; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-2); }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-mid); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── LOGIN ──────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 70% 60% at 20% 30%, rgba(99,102,241,.10) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 70%, rgba(129,140,248,.06) 0%, transparent 60%),
    var(--bg);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.login-card__header { text-align: center; margin-bottom: 32px; }
.login-card__icon   { font-size: 2.8rem; }
.login-card__title  {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 10px;
  letter-spacing: -.02em;
}
.login-card__title span { color: var(--primary-mid); }
.login-card__sub    { color: var(--muted); font-size: 0.88rem; margin-top: 6px; }

/* ── APP LAYOUT ─────────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow: hidden;
}

/* linha de destaque superior */
.sidebar::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--purple));
  flex-shrink: 0;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 18px 16px 18px;
  border-bottom: 1px solid var(--border);
}
.brand__icon { font-size: 1.5rem; line-height: 1; }
.brand__name {
  font-weight: 700;
  color: var(--text);
  font-size: 1.05rem;
  letter-spacing: -.02em;
}
.brand__name span { color: var(--primary-mid); }

.sidebar__nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.nav__item span { font-size: 1rem; line-height: 1; }
.nav__item:hover { background: var(--primary-glow); color: var(--primary); text-decoration: none; }
.nav__item.active {
  background: rgba(99,102,241,.14);
  color: var(--primary);
  font-weight: 600;
}
.nav__item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary-mid);
}

.sidebar__footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.user__name { font-size: 0.8rem; color: var(--muted); word-break: break-all; font-weight: 500; }

.main { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; }
.main__content { padding: 32px 36px; }

/* ── PAGE HEADER ────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
.page-count {
  color: var(--muted);
  font-size: 0.82rem;
  margin-left: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 20px;
}

/* ── SECTION TITLE ──────────────────────────────────────────── */
.section-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 12px 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── BADGE FILTRO ───────────────────────────────────────────── */
.badge--filter {
  display: inline-block;
  background: linear-gradient(135deg, var(--orange), #e8891a);
  color: #0d1117;
  font-size: 0.68rem;
  padding: 3px 9px;
  border-radius: 20px;
  vertical-align: middle;
  margin-left: 10px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

/* ── DASHBOARD CARDS ────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  border-top: 3px solid var(--border-2);
  position: relative;
  overflow: hidden;
}

/* reflexo sutil */
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.03) 0%, transparent 60%);
  pointer-events: none;
}

.card--blue   { border-top-color: var(--primary);  }
.card--green  { border-top-color: var(--green);   }
.card--orange { border-top-color: var(--orange);  }
.card--purple { border-top-color: var(--purple);  }
.card--gray   { border-top-color: var(--muted-2); }
.card--red    { border-top-color: var(--red); background: rgba(248,113,113,.06); }

/* ícone decorativo do card */
.card__icon {
  position: absolute;
  top: 14px; right: 16px;
  font-size: 1.6rem;
  opacity: .15;
  line-height: 1;
  pointer-events: none;
}

/* cards clicáveis */
a.card--link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
a.card--link:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
a.card--link.card--blue:hover   { border-color: var(--primary-mid); box-shadow: 0 6px 24px var(--primary-glow); }
a.card--link.card--green:hover  { border-color: var(--green);       box-shadow: 0 6px 24px var(--green-glow);   }
a.card--link.card--orange:hover { border-color: var(--orange);      box-shadow: 0 6px 24px var(--orange-glow);  }
a.card--link.card--purple:hover { border-color: var(--purple);      box-shadow: 0 6px 24px var(--purple-glow);  }
a.card--link.card--red:hover    { border-color: var(--red);         box-shadow: 0 6px 24px var(--red-glow);     }

.card__value {
  font-size: 1.85rem;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -.03em;
  line-height: 1.2;
}
.card__value--sm { font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; word-break: break-all; line-height: 1.3; }
.card__label     { color: var(--muted); font-size: 0.8rem; font-weight: 500; }
.card__hint      { color: var(--muted); font-size: 0.75rem; margin-top: 6px; line-height: 1.4; }

/* grid menor para cards de sync */
.cards-grid--sync {
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  margin-bottom: 24px;
  gap: 10px;
}
.cards-grid--sync .card { padding: 14px 14px 12px; }

/* ── PAINEL DE FILTROS REESTRUTURADO ───────────────────────── */
.filters-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 14px 20px 14px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Linha de filtros — grid de 6 colunas */
.filter-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px 14px;
  padding: 10px 0;
}

.fg-1 { grid-column: span 1; }
.fg-2 { grid-column: span 2; }
.fg-3 { grid-column: span 3; }

/* Separador entre linhas */
.filter-divider {
  height: 1px;
  background: var(--border);
}

/* Linha inferior alinhada pela base */
.filter-row--bottom { align-items: end; }

/* Campo dentro do painel */
.filter-group { display: flex; flex-direction: column; gap: 5px; }

.filter-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.filter-tip {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--primary-mid);
  background: var(--primary-glow);
  border: 1px solid rgba(99,102,241,.25);
  padding: 1px 6px;
  border-radius: 20px;
  text-transform: none;
  letter-spacing: 0;
  opacity: .85;
}

/* Par de datas de/até inline */
.date-range {
  display: flex;
  align-items: center;
  gap: 6px;
}
.date-range .field__input { flex: 1; min-width: 0; }
.date-range__sep {
  font-size: 0.75rem;
  color: var(--muted-2);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Checkboxes em linha horizontal */
.filter-checks-row {
  flex-direction: row;
  align-items: center;
  gap: 20px;
  padding-bottom: 2px;
}

/* Botões alinhados à direita */
.filter-actions {
  flex-direction: row;
  gap: 8px;
  align-items: flex-end;
  justify-content: flex-end;
}

/* Checkbox estilo */
.filter-check {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.84rem;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  font-weight: 500;
  transition: color var(--transition);
  user-select: none;
}
.filter-check:hover { color: var(--text); }
.filter-check input[type=checkbox] {
  width: 15px; height: 15px;
  accent-color: var(--primary-mid);
  cursor: pointer;
  flex-shrink: 0;
}

/* Classes legadas — mantidas para segurança */
.filters--grid, .filter-group--wide, .filter-group--checks, .filter-group--actions { /* legado */ }

.section-actions { margin-top: 8px; }
td.actions { white-space: nowrap; }
.text-muted { color: var(--muted); font-weight: 400; font-size: 0.8em; }

/* ── EMPTY STATE ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--muted);
}
.empty-state__icon { font-size: 3.2rem; margin-bottom: 16px; opacity: .6; }
.empty-state p { font-size: 0.9rem; }

/* ── DETAIL ────────────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

/* ── FORMS / FILTERS ────────────────────────────────────────── */
.field         { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field__label  { font-size: 0.82rem; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.field__input  {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 9px 13px;
  font-size: 0.875rem;
  font-family: inherit;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field__input::placeholder { color: var(--muted-2); }
.field__input:focus {
  outline: none;
  border-color: var(--primary-mid);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.field__input--select { cursor: pointer; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 20px;
}
.filters .field__input { width: auto; min-width: 180px; margin-bottom: 0; }

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  letter-spacing: .01em;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:hover  { opacity: .88; text-decoration: none; }
.btn--primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99,102,241,.30);
}
.btn--primary:hover { opacity: 1; box-shadow: 0 4px 14px rgba(99,102,241,.40); }
.btn--ghost   { background: transparent; border: 1px solid var(--border-2); color: var(--text); }
.btn--ghost:hover { background: rgba(99,102,241,.08); border-color: var(--primary); opacity: 1; }
.btn--full    { width: 100%; }
.btn--sm      { padding: 5px 11px; font-size: 0.78rem; }
.btn-logout {
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: none;
  text-align: left;
  padding: 0;
  font-family: inherit;
  transition: color var(--transition);
}
.btn-logout:hover { color: var(--red); text-decoration: none; }

/* ── TABLE ──────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

/* Objeto tem largura mínima generosa; colunas compactas encolhem para o conteúdo */
.col-orgao  { min-width: 160px; }
.col-objeto { min-width: 340px; }
.col-mod    { white-space: nowrap; }
.col-valor  { white-space: nowrap; }
.col-enc    { white-space: nowrap; }
.col-status { white-space: nowrap; }
.col-acoes  { white-space: nowrap; width: 1%; }
.table thead { background: var(--surface-2); }
.table th, .table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.table th {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  white-space: nowrap;
}
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: rgba(99,102,241,.06); }
.table tbody tr:last-child td { border-bottom: none; }
.td--objeto {
  /* sem max-width — a coluna cresce com o restante disponível */
  word-break: break-word;
  white-space: normal;
}
.td--objeto small { color: var(--muted); font-size: 0.78rem; }
.table__empty { text-align: center; color: var(--muted); padding: 48px; font-size: 0.9rem; }

/* ── BADGES / STATUS ────────────────────────────────────────── */
.badge {
  display: inline-block;
  background: rgba(99,102,241,.12);
  color: var(--primary-mid);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: .01em;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.73rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: .01em;
}
.status::before { content: '●'; font-size: .5rem; }
.status--aberta    { background: rgba(52,211,153,.12);  color: var(--green);      }
.status--encerrada { background: rgba(248,113,113,.12); color: var(--red);        }
.status--homolog   { background: rgba(99,102,241,.12);  color: var(--primary-mid); }
.status--outra     { background: rgba(107,107,143,.10); color: var(--muted);      }

/* ── PAGINATION ─────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  justify-content: center;
}
.pagination__info {
  color: var(--muted);
  font-size: 0.83rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 5px 14px;
  border-radius: 20px;
}

/* ── DETAIL ─────────────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}
.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.detail-card--full { grid-column: 1 / -1; }
.detail-card__title {
  color: var(--primary-mid);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-card__title::before {
  content: '';
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary-mid);
  opacity: .7;
}
.detail-card__sub   { color: var(--muted); font-size: 0.84rem; margin-top: 8px; }
.detail-rows { display: flex; flex-direction: column; gap: 10px; }
.detail-row  {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.84rem;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.detail-row:last-child { border-bottom: none; padding-bottom: 0; }
.detail-row span   { color: var(--muted); flex-shrink: 0; font-weight: 500; }
.detail-row strong { text-align: right; word-break: break-word; }
.value--highlight  { color: var(--green); font-size: 1rem; font-weight: 700; }

/* ── FAVORITO ───────────────────────────────────────────────── */
.btn-fav {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--muted);
  transition: all var(--transition);
  line-height: 1;
}
.btn-fav:hover { border-color: var(--orange); color: var(--orange); background: var(--orange-glow); }
.btn-fav.ativo  { border-color: var(--orange); color: var(--orange); background: var(--orange-glow); }

/* ── EMPTY STATE ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-state__icon { font-size: 3rem; margin-bottom: 16px; }

/* ── ALERT ──────────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.875rem; margin-bottom: 16px; border: 1px solid transparent; }
.alert--error,
.alert-danger  { background: rgba(248,113,113,.08); color: var(--red);        border-color: rgba(248,113,113,.25); }
.alert-success { background: rgba(99,102,241,.10); color: var(--primary-mid); border-color: rgba(99,102,241,.30); }

/* ── BADGES EXTRA ───────────────────────────────────────────── */
.badge-admin  { background: rgba(192,132,252,.12); color: var(--purple); border: 1px solid rgba(192,132,252,.22); border-radius: 4px; padding: 2px 8px; font-size: 0.73rem; font-weight: 600; }
.badge-user   { background: rgba(99,102,241,.10);  color: var(--muted);  border: 1px solid rgba(99,102,241,.20);  border-radius: 4px; padding: 2px 8px; font-size: 0.73rem; font-weight: 600; }

/* ── TOGGLE DE NOTIFICAÇÕES ─────────────────────────────────── */
.notif-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    cursor: pointer;
    flex-shrink: 0;
}
.notif-toggle__input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.notif-toggle__slider {
    position: absolute;
    inset: 0;
    background: rgba(247,82,82,.35);
    border: 1px solid rgba(247,82,82,.4);
    border-radius: 22px;
    transition: background .2s, border-color .2s;
}
.notif-toggle__slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 2px;
    top: 2px;
    background: #dc2626;
    border-radius: 50%;
    transition: transform .2s, background .2s;
}
.notif-toggle__input:checked + .notif-toggle__slider {
    background: rgba(99,102,241,.22);
    border-color: rgba(99,102,241,.50);
}
.notif-toggle__input:checked + .notif-toggle__slider::before {
    transform: translateX(18px);
    background: var(--primary-mid);
}
.notif-toggle:hover .notif-toggle__slider { filter: brightness(1.15); }

.notif-toggle__label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: .02em;
}
.notif-toggle__label--on  { color: var(--green); }
.notif-toggle__label--off { color: var(--red); }

/* ── BADGES DE RELEVÂNCIA ───────────────────────────────────── */
.rel-tag {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 0.70rem;
    font-weight: 600;
    letter-spacing: .01em;
    cursor: default;
}
/* relevante: fundo índigo suave */
.rel-tag--rel {
    background: rgba(99,102,241,.12);
    color: var(--primary-mid);
    border: 1px solid rgba(99,102,241,.25);
}
/* irrelevante: fundo laranja/âmbar suave */
.rel-tag--irrel {
    background: rgba(217,119,6,.10);
    color: #b45309;
    border: 1px solid rgba(217,119,6,.25);
}
/* pendente: cinza */
.rel-tag--pendente {
    background: rgba(107,107,143,.08);
    color: var(--muted);
    border: 1px solid rgba(107,107,143,.18);
}

/* ── TABLE ACTIONS ──────────────────────────────────────────── */
td.actions { white-space: nowrap; }

/* ── BUTTONS EXTRA ──────────────────────────────────────────── */
.btn-danger { background: rgba(220,38,38,.08); color: var(--red); border: 1px solid rgba(220,38,38,.25); }
.btn-danger:hover { background: rgba(220,38,38,.15); opacity: 1; }
.btn-sm { padding: 4px 10px; font-size: 0.78rem; }

/* ── FORM ────────────────────────────────────────────────────── */
.form-card { max-width: 520px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-group label { font-size: 0.84rem; color: var(--muted); font-weight: 600; }
.form-control {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 9px 12px;
  font-size: 0.875rem;
  font-family: inherit;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus { outline: none; border-color: var(--primary-mid); box-shadow: 0 0 0 3px var(--primary-glow); }
.form-check { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.form-check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary-mid); cursor: pointer; }
.form-check label { font-size: 0.875rem; cursor: pointer; }
.form-actions { margin-top: 24px; }
.text-muted { color: var(--muted); font-weight: 400; font-size: 0.8em; }

/* ── BTN DANGER (BEM) ────────────────────────────────────────── */
.btn--danger { background: rgba(220,38,38,.08); color: var(--red); border: 1px solid rgba(220,38,38,.25); }
.btn--danger:hover { background: rgba(220,38,38,.15); opacity: 1; }

/* ── DOCS SECTION ────────────────────────────────────────────── */
.docs-section { position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 160px; }

.docs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
  margin-bottom: 14px;
}
.docs-header__left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.docs-count {
  font-size: 0.73rem;
  font-weight: 600;
  background: rgba(99,102,241,.12);
  color: var(--primary-mid);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: 20px;
  padding: 1px 9px;
}
.docs-upload-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.docs-attach-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}

/* Chips dos arquivos selecionados */
.docs-sel-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: rgba(99,102,241,.05);
  border: 1px dashed rgba(99,102,241,.20);
  border-radius: var(--radius-sm);
}
.docs-chip {
  background: rgba(99,102,241,.12);
  color: var(--primary-mid);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Overlay de drag & drop */
.docs-dragover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(99,102,241,.08);
  border: 2.5px dashed var(--primary-mid);
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-mid);
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s ease;
  z-index: 5;
  backdrop-filter: blur(2px);
}
.docs-dragover__icon { font-size: 2rem; }
.docs-dragover--active { opacity: 1; }

/* Tabela */
.docs-table-wrap {
  margin-top: 4px;
  border-radius: var(--radius-sm);
}
.docs-row__name { word-break: break-all; }
.docs-row__icon { margin-right: 6px; }
.docs-row__size,
.docs-row__date  { white-space: nowrap; color: var(--muted); font-size: 0.82rem; }
.docs-row__actions { white-space: nowrap; width: 1%; display: flex; align-items: center; gap: 4px; }

/* Empty state */
.docs-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
}
.docs-empty__icon-wrap {
  font-size: 2.6rem;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99,102,241,.10);
  border-radius: 50%;
  margin-bottom: 4px;
}
.docs-empty__title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--text);
}
.docs-empty__sub  {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  max-width: 360px;
  line-height: 1.6;
}

/* ── Botão IA ──────────────────────────────────────────────── */
.btn--ia {
  background: linear-gradient(135deg, rgba(192,132,252,.12) 0%, rgba(99,102,241,.12) 100%);
  border: 1px solid rgba(192,132,252,.30);
  color: var(--purple);
  font-weight: 600;
  transition: var(--transition);
}
.btn--ia:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(192,132,252,.20) 0%, rgba(99,102,241,.20) 100%);
  border-color: var(--purple);
  box-shadow: 0 0 14px rgba(192,132,252,.25);
}
.btn--ia:disabled { opacity: .55; cursor: wait; }

/* ── Card IA ────────────────────────────────────────────────── */
.ia-card {
  border-color: rgba(192,132,252,.20);
  background: linear-gradient(160deg, rgba(99,102,241,.04) 0%, var(--surface) 60%);
}

.ia-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.ia-card__title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ia-icon { font-size: 1.3rem; }

.ia-card__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ia-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Badge cache/novo */
.ia-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
}
.ia-badge--cache { background: rgba(99,102,241,.12); color: var(--primary-mid); }
.ia-badge--novo  { background: rgba(52,211,153,.12);  color: var(--green);       }

/* Loading spinner */
.ia-loading {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 28px 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.ia-spinner {
  width: 22px; height: 22px;
  border: 3px solid rgba(192,132,252,.15);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: ia-spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes ia-spin { to { transform: rotate(360deg); } }

/* Erro */
.ia-erro {
  background: rgba(220,38,38,.07);
  border: 1px solid rgba(220,38,38,.2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--red);
  font-size: 0.88rem;
}

/* Recomendação destaque */
.ia-rec {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
}
.ia-rec__badge {
  font-size: 1rem;
  font-weight: 800;
  padding: 6px 18px;
  border-radius: 99px;
  letter-spacing: .03em;
  white-space: nowrap;
}
.ia-rec__badge--participar { background: rgba(99,102,241,.14); color: var(--primary-mid); border: 1px solid rgba(99,102,241,.30); }
.ia-rec__badge--avaliar    { background: rgba(217,119,6,.10);  color: var(--orange);      border: 1px solid rgba(217,119,6,.25); }
.ia-rec__badge--atencao    { background: rgba(220,38,38,.08);  color: var(--red);         border: 1px solid rgba(220,38,38,.2); }
.ia-rec__just {
  flex: 1;
  min-width: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
}

/* Seção resumo */
.ia-section { margin-bottom: 20px; }
.ia-section__title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 8px;
}
.ia-section__text {
  line-height: 1.75;
  color: var(--text);
}

/* Grid info */
.ia-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.ia-info-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ia-info-item__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.ia-info-item__value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

/* Listas */
.ia-lists {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.ia-list-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.ia-list-card--atencao {
  border-color: rgba(217,119,6,.2);
  background: rgba(217,119,6,.03);
}
.ia-list-card__title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin-bottom: 10px;
}
.ia-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ia-list li {
  font-size: 0.85rem;
  color: var(--text);
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}
.ia-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--primary-mid);
  font-weight: 700;
}
.ia-list li.ia-list__empty {
  color: var(--muted);
  font-style: italic;
}
.ia-list li.ia-list__empty::before { content: ''; }

/* v6 — midnight zinc #08080c + índigo #6366f1 */
