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

:root {
  /* Paleta */
  --red: #E2001A;
  --red-dark: #A80014;
  --red-soft: #FDE7E9;
  --black: #16171A;
  --gray-900: #23252A;
  --gray-700: #3F4147;
  --gray-500: #767981;
  --gray-300: #C9CBD1;
  --gray-100: #F1F2F4;
  --white: #FFFFFF;
  --green: #2E9E5B;
  --green-soft: #E4F5EA;
  --amber: #E8A33D;
  --amber-soft: #FCF1E0;

  /* Tipografia */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Layout */
  --sidebar-w: 240px;
  --topbar-h: 64px;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(22, 23, 26, 0.06), 0 1px 3px rgba(22, 23, 26, 0.08);
  --shadow-md: 0 4px 14px rgba(22, 23, 26, 0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  background: var(--gray-100);
  color: var(--gray-900);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

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

button { font-family: var(--font-body); cursor: pointer; }

/* ---------- Layout raiz ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--black);
  color: var(--white);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: fixed;
  top: 0; bottom: 0; left: 0;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 20px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar__brand svg { flex-shrink: 0; }

.sidebar__brand-text {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.25;
}
.sidebar__brand-text span { display: block; color: var(--gray-500); font-size: 11px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px;
  margin-bottom: 12px;
}
.sidebar__avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--gray-700);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--white);
  border: 2px solid var(--red);
  flex-shrink: 0;
  text-transform: uppercase;
}
.sidebar__user-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.sidebar__user-role { font-size: 11.5px; color: var(--gray-500); }

.sidebar__nav { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--gray-300);
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar__link svg { flex-shrink: 0; opacity: 0.85; }
.sidebar__link:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.sidebar__link.active {
  background: var(--red);
  color: var(--white);
}
.sidebar__link.active svg { opacity: 1; }

.sidebar__footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar__logout {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--gray-500);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 8px;
}
.sidebar__logout:hover { color: var(--red); background: rgba(226,0,26,0.08); }

/* ---------- Main ---------- */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar__title { font-size: 18px; }
.topbar__title .accent { color: var(--red); }
.topbar__right { display: flex; align-items: center; gap: 14px; }
.topbar__logo { height: 32px; width: auto; object-fit: contain; }
.topbar__back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--gray-700);
  padding: 6px 10px; border-radius: 8px; border: 1px solid var(--gray-100);
  background: var(--white);
}
.topbar__back:hover { background: var(--gray-100); }

.content { padding: 28px; flex: 1; }

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

.card--accent {
  border-left: 4px solid var(--red);
}

.grid {
  display: grid;
  gap: 18px;
}
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid--2 { grid-template-columns: 1fr 1fr; }
.grid--dashboard { grid-template-columns: 1.2fr 1fr; }

@media (max-width: 900px) {
  .grid--2, .grid--dashboard { grid-template-columns: 1fr; }
}

/* ---------- Stat card ---------- */
.stat-card {
  display: flex; flex-direction: column; gap: 6px;
}
.stat-card__label {
  font-size: 12px; font-weight: 600; color: var(--gray-500);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.stat-card__value {
  font-family: var(--font-display); font-size: 32px; font-weight: 700; color: var(--black);
}
.stat-card__value .sub { font-family: var(--font-mono); font-size: 15px; color: var(--gray-500); font-weight: 500; }

/* ---------- Badges / status ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--verde { background: var(--green-soft); color: var(--green); }
.badge--amber { background: var(--amber-soft); color: #B4780E; }
.badge--vermelho { background: var(--red-soft); color: var(--red-dark); }
.badge--cinza { background: var(--gray-100); color: var(--gray-700); }

.badge--pulse .dot { animation: pulse 1.6s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(226,0,26,0.5); }
  70% { box-shadow: 0 0 0 6px rgba(226,0,26,0); }
  100% { box-shadow: 0 0 0 0 rgba(226,0,26,0); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 8px;
  font-size: 13.5px; font-weight: 600;
  padding: 10px 18px;
  transition: transform 0.1s ease, background 0.15s ease, box-shadow .15s ease;
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--red); color: var(--white); }
.btn--primary:hover { background: var(--red-dark); }
.btn--ghost { background: var(--white); color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn--ghost:hover { background: var(--gray-100); }
.btn--dark { background: var(--black); color: var(--white); }
.btn--dark:hover { background: var(--gray-900); }
.btn--icon { padding: 8px; border-radius: 8px; background: transparent; border: 1px solid var(--gray-100); color: var(--gray-500); }
.btn--icon:hover { color: var(--red); border-color: var(--red-soft); background: var(--red-soft); }
.btn--sm { padding: 6px 12px; font-size: 12.5px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--gray-700); }
.field .hint { font-size: 11.5px; color: var(--gray-500); font-weight: 400; }

input[type="text"], input[type="date"], input[type="number"], input[type="email"], input[type="password"],
select, textarea {
  font-family: var(--font-body);
  font-size: 13.5px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--gray-300);
  background: var(--white);
  color: var(--gray-900);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}
textarea { resize: vertical; min-height: 80px; font-family: var(--font-body); }

/* ---------- List rows (Projetos) ---------- */
.list-row {
  background: var(--white);
  border-radius: var(--radius);
  border-left: 4px solid var(--gray-300);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  transition: box-shadow .15s ease, transform .1s ease;
}
.list-row:hover { box-shadow: var(--shadow-md); }
.list-row.--atraso { border-left-color: var(--red); }
.list-row.--prazo { border-left-color: var(--green); }
.list-row.--concluido { border-left-color: var(--gray-500); }

.list-row__main { min-width: 0; }
.list-row__eyebrow { font-size: 11px; font-weight: 600; color: var(--red); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.list-row__title { font-family: var(--font-display); font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.list-row__meta { font-size: 12.5px; color: var(--gray-500); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.list-row__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-500);
}
.empty-state h3 { color: var(--gray-700); margin-bottom: 8px; }
.empty-state p { font-size: 13.5px; margin: 0 0 16px; }

/* ---------- Skeletons ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, #e6e7ea 37%, var(--gray-100) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--black); color: var(--white);
  padding: 12px 18px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; gap: 10px;
  transform: translateY(20px); opacity: 0;
  transition: all .25s ease;
  z-index: 100;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.--erro { background: var(--red-dark); }
.toast.--sucesso { background: var(--green); }

/* ---------- Filters bar ---------- */
.filters-bar {
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
  background: var(--white); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
.filters-bar .field { margin-bottom: 0; min-width: 160px; }
.filters-bar .field--search { flex: 1; min-width: 220px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(22,23,26,0.55);
  display: flex; align-items: center; justify-content: center; z-index: 200;
  opacity: 0; transition: opacity .18s ease;
  padding: 20px;
}
.modal-overlay.show { opacity: 1; }
.modal-box {
  background: var(--white); border-radius: 14px; padding: 26px; width: 100%; max-width: 420px;
  box-shadow: var(--shadow-md); transform: translateY(10px); transition: transform .18s ease;
}
.modal-overlay.show .modal-box { transform: translateY(0); }
.modal-box__title { font-size: 17px; margin-bottom: 8px; }
.modal-box__msg { font-size: 13px; color: var(--gray-700); line-height: 1.5; margin: 0; }
.modal-box__erro { display: none; background: var(--red-soft); color: var(--red-dark); font-size: 12px; font-weight: 500; padding: 8px 10px; border-radius: 8px; margin-top: 12px; }
.modal-box__erro.show { display: block; }
.modal-box__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------- Status picker (pills clicáveis) ---------- */
.status-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.status-pill {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px; border-radius: 10px; border: 1.5px solid var(--gray-300);
  font-size: 12.5px; font-weight: 600; color: var(--gray-700); background: var(--white);
  transition: all .15s ease;
}
.status-pill:hover { border-color: var(--gray-500); }
.status-pill.current {
  border-color: transparent; color: var(--white); cursor: default;
}
.status-pill.current.--nao-iniciado { background: var(--gray-500); }
.status-pill.current.--em-andamento { background: #2E6FE8; }
.status-pill.current.--pausado { background: var(--amber); }
.status-pill.current.--blocker { background: var(--red); }
.status-pill.current.--concluido { background: var(--green); }

/* ---------- Banner grande de alerta (Blocker/Pausado/Concluído) ---------- */
.status-banner {
  border-radius: 12px; padding: 16px 20px; margin-bottom: 18px;
  display: flex; align-items: flex-start; gap: 14px;
}
.status-banner__icon { font-size: 26px; line-height: 1; flex-shrink: 0; }
.status-banner__title { font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.status-banner__desc { font-size: 12.5px; line-height: 1.5; opacity: 0.9; }
.status-banner--blocker { background: var(--red); color: var(--white); }
.status-banner--pausado { background: var(--amber); color: var(--white); }
.status-banner--concluido { background: var(--green-soft); color: var(--green); border: 1.5px solid var(--green); }
.status-banner--concluido .status-banner__title { color: var(--green); }

/* scrollbar discreta */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
