/* ── Phosphor Icons Light — Sistema de Ícones Premium ── */
@import url('https://cdn.jsdelivr.net/npm/@phosphor-icons/web@2.1.2/src/light/style.css');

:root {
  /* ========== FUNDOS ========== */
  --bg-primary: #FAFAF8;
  --bg-secondary: #F5F3EF;
  --bg-elevated: #FFFFFF;
  --bg-footer: #F0EDE6;

  /* ========== TEXTOS ========== */
  --text-primary: #1A1A1A;
  --text-secondary: #4A4A4A;
  --text-muted: #8A8A8A;
  --text-light: #B0B0B0;

  /* ========== DOURADO (Acento Principal) ========== */
  --accent-gold: #B8860B;
  --accent-gold-light: #D4A853;
  --accent-gold-subtle: #F5E6C8;
  --accent-gold-bg: #FAF6ED;
  --accent-gold-hover: #9A7209;

  /* ========== BORDAS ========== */
  --border-light: #E8E6E1;
  --border-medium: #D4D0C8;
  --border-gold: rgba(212, 168, 83, 0.4);

  /* ========== SOMBRAS ========== */
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-elevated: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-gold: 0 4px 16px rgba(184, 134, 11, 0.08);
  --shadow-gold-strong: 0 0 20px rgba(184, 134, 11, 0.15);

  /* ========== SEÇÃO EXCLUSIVA DO PROMPT (O COFRE) ========== */
  --prompt-bg: #0D0D0D;
  --prompt-bg-code: #1A1A1A;
  --prompt-bg-code-hover: #222222;
  --prompt-text: #E8E6E1;
  --prompt-text-muted: #8A8A7A;
  --prompt-accent: #D4A853;
  --prompt-border: #2A2A2A;
  --prompt-border-gold: rgba(212, 168, 83, 0.3);

  /* ========== STATUS ========== */
  --success: #2D6A4F;
  --success-bg: #E8F5E9;
  --info: #1B4965;
  --info-bg: #E3F2FD;
  --warning: #B8860B;
  --warning-bg: #FFF8E1;

  /* ========== TIPOGRAFIA ========== */
  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body: 'Source Sans 3', 'Segoe UI', -apple-system, sans-serif;
  --font-code: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* ========== ESPAÇAMENTO ========== */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* ========== BORDER RADIUS ========== */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 999px;

  /* ========== TRANSIÇÕES ========== */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --transition-spring: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ========== LAYOUT ========== */
  --sidebar-width: 280px;
  --header-height: 72px;
  --content-max-width: 860px;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Hide scrollbars but keep functionality */
::-webkit-scrollbar {
  width: 0px;
  background: transparent;
}

* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

/* Timeline Styles */
.timeline-item {
  position: relative;
  padding-left: 28px;
  border-left: 1px solid var(--border-light);
  padding-bottom: 24px;
}

.timeline-item:last-child {
  border-left-color: transparent;
}

.timeline-dot {
  position: absolute;
  left: -5px;
  top: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-gold);
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 0 3px var(--accent-gold-subtle);
}

.timeline-link {
  display: block;
  padding: 12px 16px;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.timeline-link:hover {
  border-color: var(--accent-gold);
  transform: translateX(4px);
  box-shadow: var(--shadow-soft);
}

/* Global Action Button */
.btn-complete-step {
  background: var(--accent-gold);
  color: white;
  font-weight: 700;
  padding: 16px 48px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 10px 20px rgba(184, 134, 11, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-complete-step:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 15px 30px rgba(184, 134, 11, 0.3);
  background: var(--accent-gold-hover);
}

.btn-complete-step:active {
  transform: translateY(0) scale(0.98);
}

.btn-complete-step.completed {
  background: var(--success);
  box-shadow: 0 10px 20px rgba(45, 106, 79, 0.2);
}

.usage-counter {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

/* Utils */
.oculto { display: none !important; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ========== SEARCH IN SIDEBAR ========== */
.search-sidebar {
  margin-bottom: var(--space-md);
}
.search-sidebar__wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.search-sidebar__icon {
  position: absolute;
  left: 10px;
  font-size: 0.8rem;
  pointer-events: none;
}
.search-sidebar__input {
  width: 100%;
  padding: 10px 32px 10px 32px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition-base);
}
.search-sidebar__input:focus {
  border-color: var(--accent-gold-light);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.1);
  background: var(--bg-elevated);
}
.search-sidebar__input::placeholder {
  color: var(--text-light);
}
.search-sidebar__clear {
  position: absolute;
  right: 8px;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 4px;
  line-height: 1;
}
.search-sidebar__clear:hover {
  color: var(--text-primary);
}
.search-sidebar__results {
  margin-top: var(--space-xs);
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-medium);
  max-height: 300px;
  overflow-y: auto;
}
.search-sidebar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--border-light);
}
.search-sidebar__item:last-child {
  border-bottom: none;
}
.search-sidebar__item:hover {
  background: var(--accent-gold-bg);
}
.search-sidebar__item-icon {
  font-size: 1rem;
  flex-shrink: 0;
}
.search-sidebar__item-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.search-sidebar__item-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-sidebar__item-group {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.search-sidebar__empty {
  padding: 16px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Histórico de Casos — Cards Premium ── */
.historico-casos {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 2px;
}

.caso-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 16px 14px 19px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}
.caso-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--border-medium);
  transition: background var(--transition-base);
}
.caso-card:hover {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-gold);
}
.caso-card:hover::before { background: var(--accent-gold); }

/* Cabeçalho */
.caso-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.caso-card__nome {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.caso-card__nome i { color: var(--accent-gold-light); font-size: 1.15rem; flex-shrink: 0; }

/* Badge de progresso */
.caso-card__badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
}
.caso-card__badge--zero     { background: var(--bg-secondary); color: var(--text-muted); }
.caso-card__badge--progress { background: var(--accent-gold-subtle); color: var(--accent-gold); border: 1px solid var(--border-gold); }
.caso-card__badge--done     { background: var(--success-bg); color: var(--success); }

/* Meta info */
.caso-card__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.caso-card__meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.79rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.caso-card__meta-row i { color: var(--accent-gold-light); font-size: 0.85rem; flex-shrink: 0; }

/* Chips de grupo */
.caso-card__grupos {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 10px 0 12px;
  border-top: 1px solid var(--border-light);
  margin-bottom: 2px;
}
.caso-grupo-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.67rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.03em;
  line-height: 1.6;
}
.caso-grupo-chip i { font-size: 0.72rem; }
.caso-grupo-chip--done     { background: var(--success-bg); color: var(--success); }
.caso-grupo-chip--progress { background: var(--accent-gold-bg); color: var(--accent-gold); border: 1px solid var(--border-gold); }

/* Ações */
.caso-card__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}
.caso-card__btn-continuar {
  flex: 1;
  padding: 8px 14px;
  background: var(--accent-gold);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  letter-spacing: 0.04em;
  transition: background var(--transition-base), transform var(--transition-fast);
}
.caso-card__btn-continuar:hover { background: var(--accent-gold-hover); transform: translateY(-1px); }
.caso-card__btn-remover {
  padding: 8px 11px;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-light);
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition-base), border-color var(--transition-base), background var(--transition-base);
}
.caso-card__btn-remover:hover { color: #B91C1C; border-color: #FECACA; background: #FEF2F2; }

/* Confirmação de remoção */
.caso-card__confirm-delete {
  display: none;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  font-size: 0.8rem;
  color: #B91C1C;
}
.caso-card__confirm-delete.visivel { display: flex; }
.caso-card__confirm-sim,
.caso-card__confirm-nao {
  background: none;
  border: none;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.caso-card__confirm-sim { color: #B91C1C; }
.caso-card__confirm-sim:hover { background: #FEE2E2; }
.caso-card__confirm-nao { color: var(--text-muted); }
.caso-card__confirm-nao:hover { background: var(--bg-secondary); }

/* Heading do histórico */
.historico-titulo {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Phosphor Icons — Regras de Integração ── */
/* Alinhamento vertical padrão para ícones inline */
i[class*="ph-"] {
  vertical-align: middle;
  line-height: 1;
  font-style: normal;
}
/* Tamanhos contextuais */
.sidebar-grupo-icone i[class*="ph-"]  { font-size: 1.05rem; }
.sidebar-grupo-arrow i[class*="ph-"]  { font-size: 0.8rem;  }
.sidebar-prompt-check i[class*="ph-"] { font-size: 0.95rem; }
.search-sidebar__icon i[class*="ph-"] { font-size: 1rem;    }
.search-sidebar__clear i[class*="ph-"]{ font-size: 0.85rem; cursor: pointer; }
.search-sidebar__item-icon i[class*="ph-"] { font-size: 1rem; }
.group-icon-large i[class*="ph-"]     { font-size: 2.6rem;  }
.prompt-card-arrow i[class*="ph-"]    { font-size: 1rem;    }
.grupo-hero__icon i[class*="ph-"]     { font-size: 2.4rem;  color: var(--accent-gold); }

/* ── Sidebar Header ───────────────────────────────────────── */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ── Botão Painel ─────────────────────────────────────────── */
.btn-painel {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: var(--accent-gold);
  color: white !important;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition-base);
}
.btn-painel:hover {
  background: var(--accent-gold-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold-strong);
}
.btn-painel i { font-size: 0.9rem; }
