/* Mission Control CRM — Estilos compartilhados */

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

:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --border: #1e1e2e;
  --purple: #8b5cf6;
  --purple-dark: #7c3aed;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --dim: #475569;
  --green: #4ade80;
  --red: #f87171;
  --yellow: #facc15;
  --radius: 10px;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  line-height: 1.5;
}

/* ---- Tipografia ---- */
h1, h2, h3 { font-weight: 700; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.1rem; }
small { font-size: 0.78rem; color: var(--muted); }

/* ---- Botoes ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, opacity 0.15s;
  font-family: var(--font);
}
.btn-primary { background: var(--purple); color: #fff; }
.btn-primary:hover { background: var(--purple-dark); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface); color: var(--text); }
.btn-danger { background: #2d1515; color: var(--red); border: 1px solid #3d2020; }
.btn-danger:hover { background: #3d2020; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }

/* ---- Formulario ---- */
input, select, textarea {
  background: #0d0d18;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  font-size: 0.875rem;
  font-family: var(--font);
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--purple);
}
input::placeholder { color: var(--dim); }
label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.35rem; }
.form-group { margin-bottom: 1rem; }

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

/* ---- Tabela ---- */
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
td { padding: 0.65rem 0.75rem; }
tr:not(:last-child) td { border-bottom: 1px solid #0f0f1a; }
tr:hover td { background: #0d0d16; }

/* ---- Badge ---- */
.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-green { background: #052e16; color: var(--green); }
.badge-red { background: #2d1515; color: var(--red); }
.badge-yellow { background: #1c1a05; color: var(--yellow); }
.badge-purple { background: #1e1030; color: var(--purple); }

/* ---- Modal ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  z-index: 200;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-color: #1a3a2a; color: var(--green); }
.toast.error { border-color: #3d2020; color: var(--red); }

/* ---- Paginacao ---- */
.pagination {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}
.pagination button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: var(--font);
}
.pagination button:hover { background: #1a1a28; }
.pagination button:disabled { opacity: 0.4; cursor: default; }
.pagination .page-info { font-size: 0.8rem; color: var(--muted); }

/* ---- Loader ---- */
.loader {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Empty state ---- */
.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}
.empty p { margin-top: 0.5rem; font-size: 0.875rem; }
