/* ============================================================
   UI compartilhada — Maldivas Agents
   Identidade visual do Globus Workflow: tema claro, topbar navy,
   destaque teal, Montserrat, cards brancos, cabeçalho de tabela escuro.
   Tokens + top bar + cards + tabelas + badges + inputs
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap");

:root {
  --bg: #e5e5e5;            /* fundo da página (Workflow: v-main) */
  --nav: #2b3544;           /* topbar / cabeçalhos de tabela (secondary) */
  --card: #ffffff;
  --card-2: #f5f5f5;        /* superfícies internas (inputs, tiles, tracks) */
  --line: #c9cfd8;          /* bordas de input */
  --line-soft: rgba(43, 53, 68, 0.1);
  --text: #1e293b;
  --text-2: #39424e;        /* texto de tabela/corpo (Workflow) */
  --muted: #8a94a1;
  --brand: #00c7ba;         /* primary (teal Workflow) */
  --brand-600: #00b0a5;
  --brand-ink: #ffffff;     /* texto sobre o teal */
  --accent: #26a69a;
  --danger: #cd0000;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(38, 50, 56, 0.06);
}

* { box-sizing: border-box; }

/* min-height (e não height): páginas mais altas que a viewport continuam
   cobertas pelo fundo. */
html { min-height: 100%; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Top bar (navy, como o Workflow) ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.topbar-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.2px;
  white-space: nowrap;
}
.brand .logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.brand small {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}
.topnav { display: flex; gap: 4px; }
.topnav a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.topnav a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.topnav a.active {
  color: var(--brand);
  background: rgba(255, 255, 255, 0.1);
}
.topnav .org-chip {
  margin-left: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.25);
  white-space: nowrap;
  align-self: center;
}
.topnav a.sair { color: #ff8a80; }

/* ---------- Layout ---------- */

.wrap { max-width: 1160px; margin: 0 auto; padding: 26px 20px 48px; }

.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -0.3px; font-weight: 700; color: var(--text); }
.page-head .sub { color: var(--muted); font-size: 13.5px; margin: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card h2 {
  font-size: 13px;
  margin: 0 0 14px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
}
.card h2 .note { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); }

/* ---------- Botões e inputs ---------- */

button, .btn {
  background: var(--brand);
  color: var(--brand-ink);
  border: 0;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
  font-family: inherit;
  text-transform: none;
  transition: background 0.15s, box-shadow 0.2s, transform 0.05s;
}
button:hover, .btn:hover { background: var(--brand-600); color: #fff; box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2); }
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.ghost, .btn.ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--line);
}
button.ghost:hover, .btn.ghost:hover { background: rgba(43, 53, 68, 0.06); color: var(--text); box-shadow: none; }
a.btn { text-decoration: none; display: inline-block; text-align: center; }

input[type="text"], input[type="search"], input[type="password"], select {
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
input[type="text"]:focus, input[type="search"]:focus, input[type="password"]:focus, select:focus {
  border-color: var(--brand);
}
::placeholder { color: #9c9c9c; }

/* ---------- Tabelas (cabeçalho escuro, como o Workflow) ---------- */

.table-wrap { overflow-x: auto; margin: 0 -6px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; }
th {
  background: var(--nav);
  color: #fff;
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
th:first-child { border-radius: 6px 0 0 6px; }
th:last-child { border-radius: 0 6px 6px 0; }
td { border-bottom: 1px solid var(--line-soft); color: var(--text-2); }
tbody tr { transition: background 0.1s; }
tbody tr:hover { background: rgba(0, 199, 186, 0.05); }

/* ---------- Badges ---------- */

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.b-pending  { background: rgba(43, 53, 68, 0.09);   color: #546e7a; }
.b-sending  { background: rgba(2, 119, 189, 0.12);  color: #0277bd; }
.b-sent     { background: rgba(0, 199, 186, 0.14);  color: #00897b; }
.b-failed   { background: rgba(221, 44, 0, 0.1);    color: #c62828; }
.b-replied  { background: rgba(255, 193, 7, 0.2);   color: #9a7100; }
.b-interessado   { background: rgba(46, 125, 50, 0.13); color: #2e7d32; }
.b-sem_interesse { background: rgba(221, 44, 0, 0.1);   color: #c62828; }
.b-contratou     { background: var(--brand); color: #fff; }
.b-desistiu      { background: rgba(255, 193, 7, 0.2);  color: #9a7100; }
.b-indefinido    { background: rgba(43, 53, 68, 0.09);  color: #546e7a; }
.b-info     { background: rgba(2, 119, 189, 0.12); color: #0277bd; }

/* ---------- Modal ---------- */

.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(30, 41, 59, 0.45);
  display: none;
  place-items: center;
  z-index: 100;
  padding: 20px;
}
.modal-bg.aberto { display: grid; }
.modal {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(30, 41, 59, 0.25);
  width: min(680px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
}
.modal h3 {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}
.modal h3 code { font-size: 12px; }
/* Grade previsível dentro do modal: 2 colunas iguais (auto-fit desalinha). */
.modal .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.modal .form-grid .cheio { grid-column: 1 / -1; }
@media (max-width: 560px) { .modal .form-grid { grid-template-columns: 1fr; } }
.modal .modal-acoes {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 18px;
}

/* ---------- Mensagens ---------- */

.msg { font-size: 13px; }
.msg.err { color: var(--danger); }
.msg.ok { color: #00897b; }

code {
  background: var(--card-2);
  border: 1px solid var(--line-soft);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-2);
}
