/* ═══════════════════════════════════════════════
   ESTILO "MÁRMORE & AÇO" — Vivian Coser
   Gabinete da Primeira-Dama do Espírito Santo
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Cormorant+Garamond:wght@400;500;600;700&display=swap');

:root {
  --bg: #faf9f6;
  --bg-card: #ffffff;
  --sidebar: #151c18;
  --sidebar-hover: #1e2722;
  --sidebar-text: #a8b5ae;
  --sidebar-active: #e0d5c5;
  --text: #2c2c2c;
  --text-light: #6b6b6b;
  --text-muted: #999;
  --bronze: #8b7355;
  --bronze-light: #c4a97d;
  --salvia: #5b7b6a;
  --salvia-light: #7da08a;
  --terracota: #c2513a;
  --terracota-light: #e0735a;
  --border: #e8e4df;
  --shadow: 0 2px 16px rgba(21, 28, 24, 0.06);
  --shadow-lg: 0 8px 40px rgba(21, 28, 24, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  /* Cores de alerta */
  --alert-info: #4a7d9b;
  --alert-atencao: #d4a435;
  --alert-urgente: #d9773b;
  --alert-atrasado: #c2513a;

  /* Status colors */
  --st-nao-iniciado: #a0a0a0;
  --st-em-andamento: #5b7b6a;
  --st-concluido: #4a9b6d;
  --st-atrasado: #c2513a;
  --st-suspenso: #8b7355;
  --st-aguardando: #d4a435;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ──────────────────────────────── */
.sidebar {
  width: 260px;
  background: var(--sidebar);
  color: var(--sidebar-text);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-shadow: 4px 0 30px rgba(0,0,0,0.15);
}

.sidebar-header {
  padding: 32px 24px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: #e0d5c5;
  letter-spacing: 0.03em;
  line-height: 1.3;
}

.sidebar-header span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--bronze-light);
  display: block;
  margin-top: 4px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 400;
  transition: var(--transition);
  border-left: 3px solid transparent;
  letter-spacing: 0.01em;
}

.sidebar-nav a:hover {
  background: var(--sidebar-hover);
  color: #d5cfc4;
  border-left-color: var(--bronze);
}

.sidebar-nav a.active {
  background: var(--sidebar-hover);
  color: var(--sidebar-active);
  border-left-color: var(--bronze);
  font-weight: 500;
}

.sidebar-nav a svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-nav a.active svg,
.sidebar-nav a:hover svg {
  opacity: 1;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 0.75rem;
  color: rgba(168, 181, 174, 0.5);
}

.sidebar-footer .user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--sidebar-text);
}

.sidebar-footer .user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bronze);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ── MAIN ──────────────────────────────── */
.main {
  margin-left: 260px;
  flex: 1;
  padding: 0;
  min-height: 100vh;
}

/* ── TOP BAR ──────────────────────────────── */
.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ── CONTENT ──────────────────────────────── */
.content {
  padding: 32px;
}

/* ── CARDS ──────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.card-body {
  padding: 24px;
}

/* ── DASHBOARD KPI CARDS ────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 140px;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  border-radius: 4px 0 0 4px;
}

.kpi-card.total::before { background: var(--bronze); }
.kpi-card.andamento::before { background: var(--salvia); }
.kpi-card.concluido::before { background: #4a9b6d; }
.kpi-card.atrasado::before { background: var(--terracota); }

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.kpi-card .kpi-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.kpi-card .kpi-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.kpi-card.total .kpi-value { color: var(--bronze); }
.kpi-card.andamento .kpi-value { color: var(--salvia); }
.kpi-card.concluido .kpi-value { color: #4a9b6d; }
.kpi-card.atrasado .kpi-value { color: var(--terracota); }

.kpi-card .kpi-sub {
  font-size: 0.78rem;
  color: var(--text-light);
}

/* ── CHARTS ROW ─────────────────────────── */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.chart-container {
  position: relative;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-container canvas {
  max-height: 250px;
}

/* ── ALERTAS ─────────────────────────── */
.alerta-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.alerta-item:last-child { border-bottom: none; }

.alerta-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

.alerta-dot.info { background: var(--alert-info); }
.alerta-dot.atencao { background: var(--alert-atencao); }
.alerta-dot.urgente { background: var(--alert-urgente); }
.alerta-dot.atrasado { background: var(--alert-atrasado); }

.alerta-info { flex: 1; }
.alerta-msg { font-size: 0.85rem; color: var(--text); line-height: 1.4; }
.alerta-data { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

.alerta-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
  white-space: nowrap;
}

.alerta-badge.info { background: #e8f0f5; color: var(--alert-info); }
.alerta-badge.atencao { background: #fef8e7; color: var(--alert-atencao); }
.alerta-badge.urgente { background: #fef0e8; color: var(--alert-urgente); }
.alerta-badge.atrasado { background: #fde8e4; color: var(--alert-atrasado); }

/* ── BUTTONS ─────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.01em;
  font-family: 'Inter', sans-serif;
}

.btn-primary {
  background: var(--bronze);
  color: white;
}
.btn-primary:hover { background: #7a6448; }

.btn-salvia {
  background: var(--salvia);
  color: white;
}
.btn-salvia:hover { background: #4d6b5a; }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--bronze); color: var(--bronze); }

.btn-sm {
  padding: 6px 14px;
  font-size: 0.78rem;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 0.7rem;
  border-radius: 6px;
}

.btn-danger {
  background: var(--terracota);
  color: white;
}
.btn-danger:hover { background: #a84330; }

.btn-ghost {
  background: transparent;
  color: var(--text-light);
}
.btn-ghost:hover { color: var(--text); background: rgba(0,0,0,0.03); }

/* ── TABLES ─────────────────────────── */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

thead th {
  text-align: left;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

tbody tr:hover {
  background: rgba(139, 115, 85, 0.03);
}

/* ── STATUS BADGES ─────────────────────────── */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-nao-iniciado { background: #f0f0f0; color: var(--st-nao-iniciado); }
.badge-em-andamento { background: #e8f0ea; color: var(--st-em-andamento); }
.badge-planejamento { background: #edf0f3; color: #5a7d9a; }
.badge-concluido { background: #e6f3ec; color: var(--st-concluido); }
.badge-atrasado { background: #fde8e4; color: var(--st-atrasado); }
.badge-suspenso { background: #f0ece6; color: var(--st-suspenso); }
.badge-aguardando { background: #fef8e7; color: var(--st-aguardando); }
.badge-aguardando-terceiro { background: #fef8e7; color: #b8932e; }

/* ── PROGRESS BAR ─────────────────────────── */
.progress-bar {
  height: 6px;
  background: #ece8e2;
  border-radius: 3px;
  overflow: hidden;
  width: 100%;
  min-width: 60px;
}

.progress-bar .fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.fill-0 { background: #d0d0d0; }
.fill-low { background: var(--terracota); }
.fill-mid { background: var(--bronze); }
.fill-high { background: var(--salvia); }
.fill-100 { background: #4a9b6d; }

/* ── FORMS ─────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--bg-card);
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--bronze);
  box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.08);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* ── PAGE HEADER ─────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 600;
}

/* ── TABS ─────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}

.tab {
  padding: 12px 20px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  letter-spacing: 0.02em;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--bronze); border-bottom-color: var(--bronze); }

/* ── SUB-ETAPAS AGRUPADAS ─────────────── */
.fase-group {
  margin-bottom: 28px;
}

.fase-header {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--bronze);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.fase-header .fase-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--bronze);
}

/* ── NOTIFICATION TOAST ─────────────── */
.toast {
  position: fixed;
  top: 20px; right: 20px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 999;
  animation: slideIn 0.3s ease;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.toast.success { background: var(--salvia); }
.toast.error { background: var(--terracota); }
.toast.info { background: var(--alert-info); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── EXPORT / PRINT ─────────────────── */
@media print {
  .sidebar, .topbar, .btn, form { display: none !important; }
  .main { margin-left: 0 !important; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  body { background: white; }
}

/* ── RESPONSIVE ─────────────────── */
@media (max-width: 1200px) {
  .charts-row { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { width: 0; overflow: hidden; }
  .main { margin-left: 0; }
  .content { padding: 16px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 12px 16px; }
}

/* ── EMPTY STATE ─────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 64px; height: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state p {
  font-size: 0.9rem;
  max-width: 400px;
  margin: 0 auto 16px;
}

/* ── ANIMAÇÕES ─────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-up {
  animation: fadeUp 0.4s ease forwards;
}

/* ── TIMELINE (reuniões próximas) ─── */
.timeline-item {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.timeline-item:last-child { border-bottom: none; }

.timeline-date {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.timeline-date .day {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--bronze);
  line-height: 1;
}

.timeline-date .month {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.timeline-content h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.timeline-content p {
  font-size: 0.78rem;
  color: var(--text-light);
}

/* ── IA SUGGESTION BOX ─────────────── */
.ia-box {
  background: #f7f4ef;
  border: 1px dashed var(--bronze-light);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 20px;
}

.ia-box h4 {
  font-size: 0.88rem;
  color: var(--bronze);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ia-suggestion {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 8px;
  font-size: 0.83rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ia-suggestion .sug-info {
  flex: 1;
}

.ia-suggestion .sug-responsavel {
  font-size: 0.7rem;
  color: var(--bronze);
  font-weight: 600;
}

.ia-suggestion .sug-prazo {
  font-size: 0.7rem;
  color: var(--text-muted);
}
