/* ============================================================
   Gestão 360 — identidade própria (violeta + verde/azul/âmbar/
   vermelho pros status de execução), sem relação com os outros
   2 sistemas deste cliente.
   ============================================================ */
:root {
  --primary: #6d28d9;
  --primary-dark: #5521a8;
  --primary-50: #f5f3ff;
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-500: #64748b;
  --slate-300: #cbd5e1;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --blue: #2563eb;
  --blue-bg: #dbeafe;
  --amber: #d97706;
  --amber-bg: #fef3c7;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--slate-50);
  color: var(--slate-900);
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 4px; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 15px; }
h3 { font-size: 16px; }
h4 { font-size: 13.5px; }
.muted { color: var(--slate-500); font-size: 12.5px; margin: 0; }
.empty { color: var(--slate-500); padding: 18px; text-align: center; }
.loading { color: var(--slate-500); padding: 40px; text-align: center; font-size: 13.5px; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--slate-900); color: #e2e8f0; padding: 20px 14px;
  display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.brand__mark { width: 32px; height: 32px; flex: none; background: var(--primary); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 11px; color: #fff; }
.brand__txt { font-weight: 700; font-size: 13px; line-height: 1.3; }
.brand__txt small { font-weight: 500; font-size: 10.5px; color: #94a3b8; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  color: #cbd5e1; font-size: 13.5px; font-weight: 500;
}
.nav__item:hover { background: rgba(255, 255, 255, .06); }
.nav__item.is-active { background: var(--primary); color: #fff; }
.sidebar__foot { margin-top: auto; font-size: 11px; color: #64748b; display: flex; flex-direction: column; gap: 8px; }
.sidebar__user { font-size: 12px; color: #cbd5e1; margin-bottom: 8px; }
.sidebar__logout { width: 100%; }
.content { padding: 26px 32px 60px; min-width: 0; }

/* ---------- view head / breadcrumb ---------- */
.view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.breadcrumb { font-size: 12.5px; margin-bottom: 8px; }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--slate-300); background: #fff; color: var(--slate-700);
  padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn:hover { background: var(--slate-100); }
.btn--primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); }
.btn--danger { background: #fff; border-color: var(--red); color: var(--red); }
.btn--danger:hover { background: var(--red-bg); }
.btn--sm { padding: 6px 10px; font-size: 12.5px; }

/* ---------- cards / grid ---------- */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); display: block; color: inherit; }
.card--click:hover { box-shadow: 0 4px 14px rgba(15, 23, 42, .1); }
.card.mb { margin-bottom: 18px; }
.card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 14px 16px 8px; }
.card__body { padding: 0 16px 16px; }
.card__pad { padding: 16px; }

/* ---------- contagens do dashboard ---------- */
.dash-contagem { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 14px; padding: 16px; }
.dash-contagem > div { display: flex; flex-direction: column; gap: 2px; }
.dash-contagem b { font-size: 22px; font-weight: 800; }
.dash-contagem span { font-size: 11.5px; color: var(--slate-500); text-transform: uppercase; letter-spacing: .03em; }
.dash-contagem .good b { color: var(--green); }
.dash-contagem .bad b { color: var(--red); }
.dash-contagem .muted2 b { color: var(--slate-500); }
.good { color: var(--green); font-weight: 700; }
.bad { color: var(--red); font-weight: 700; }

/* ---------- barra de progresso ---------- */
.barra { height: 8px; border-radius: 999px; background: var(--slate-100); overflow: hidden; }
.barra__fill { height: 100%; background: var(--primary); border-radius: 999px; }

/* ---------- badges / tags ---------- */
.badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.b-ativo, .b-ativa, .b-concluido, .b-concluida { background: var(--green-bg); color: var(--green); }
.b-em_andamento { background: var(--blue-bg); color: var(--blue); }
.b-nao_iniciado, .b-nao_iniciada, .b-inativa { background: var(--slate-100); color: var(--slate-500); }
.b-cancelado { background: var(--slate-100); color: var(--slate-500); text-decoration: line-through; }
.b-atrasado { background: var(--red-bg); color: var(--red); }
.tag-fase { display: inline-block; font-size: 11px; font-weight: 700; color: var(--primary); background: var(--primary-50); padding: 3px 9px; border-radius: 999px; margin-top: 6px; }
.senha-temp { font-family: monospace; font-size: 16px; font-weight: 700; background: var(--slate-100); padding: 10px 14px; border-radius: 8px; text-align: center; letter-spacing: .04em; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--slate-100); vertical-align: middle; }
.tbl thead th { color: var(--slate-500); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .02em; }
.t-strong { font-weight: 700; }

/* ---------- definition list (5W2H) ---------- */
.dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.dl dt { font-size: 11px; color: var(--slate-500); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 2px; }
.dl dd { margin: 0; font-size: 13.5px; font-weight: 600; }

/* ---------- fields / forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--slate-700); margin-bottom: 5px; }
.field-inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.field-inline label { font-size: 12.5px; font-weight: 600; color: var(--slate-700); }
.input {
  width: 100%; padding: 9px 11px; border: 1px solid var(--slate-300); border-radius: 8px;
  font-size: 13.5px; font-family: inherit; background: #fff; color: var(--slate-900);
}
.input:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.input--sm { width: auto; padding: 7px 9px; font-size: 12.5px; }
textarea.input { resize: vertical; font-family: inherit; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--slate-900); color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: .2s; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 100; }
.modal.open { display: flex; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); }
.modal__box { position: relative; background: #fff; border-radius: 12px; width: 460px; max-width: calc(100vw - 32px); max-height: calc(100vh - 40px); overflow: auto; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.modal__box.wide { width: 640px; }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--slate-100); }
.modal__x { border: none; background: none; font-size: 20px; cursor: pointer; color: var(--slate-500); }
.modal__body { padding: 18px; }
.modal__foot { padding: 14px 18px; border-top: 1px solid var(--slate-100); display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- login ---------- */
.boot-loading { display: flex; align-items: center; justify-content: center; height: 100vh; color: var(--slate-500); font-size: 14px; }
.login-screen { display: flex; min-height: 100vh; }
.login-hero {
  flex: 1.15; display: flex; align-items: center; padding: 60px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--primary) 0%, var(--slate-900) 100%);
  color: #fff;
}
.login-hero::before {
  content: ""; position: absolute; width: 460px; height: 460px; border-radius: 50%;
  background: rgba(255, 255, 255, .06); top: -140px; right: -140px;
}
.login-hero::after {
  content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .12); bottom: -100px; left: -60px;
}
.login-hero__inner { position: relative; max-width: 440px; }
.login-hero__eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #d8c4fb; margin-bottom: 14px; }
.login-hero h1 { font-size: 32px; line-height: 1.2; margin-bottom: 16px; }
.login-hero p { font-size: 14px; line-height: 1.6; color: rgba(255, 255, 255, .78); margin: 0; }
.login-panel { flex: 1; display: flex; align-items: center; justify-content: center; background: var(--slate-50); padding: 40px 24px; }
.login-card { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 36px 32px; width: 100%; max-width: 340px; }
.login-title { text-align: center; margin-bottom: 2px; }
.login-sub { text-align: center; margin-bottom: 20px; }
.login-erro { color: var(--red); font-size: 12.5px; margin: -6px 0 14px; }
.login-btn { width: 100%; }

@media (max-width: 840px) {
  .login-hero { display: none; }
  .login-panel { background: var(--slate-900); }
  .login-card { box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
}

/* ---------- responsivo ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; padding: 12px 16px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar__foot { margin-top: 0; display: flex; align-items: center; gap: 8px; }
  .sidebar__user { margin-bottom: 0; }
  .sidebar__logout { width: auto; }
  .content { padding: 18px; }
}
