:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-2: #273449;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --danger: #dc2626;
  --border: #334155;
  --ok: #16a34a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: #f1f5f9;
  color: #0f172a;
}
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: .85rem; }
.error { color: var(--danger); font-size: .85rem; min-height: 1rem; }
button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: .55rem 1rem;
  background: var(--accent);
  color: #fff;
  font-size: .9rem;
}
button:hover { background: var(--accent-hover); }
button.link { background: none; color: var(--muted); padding: .4rem .6rem; }
button.link:hover { color: #fff; background: none; text-decoration: underline; }
input, select, textarea {
  width: 100%;
  padding: .5rem .6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
  background: #fff;
  color: #0f172a;
}

/* Login */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-card {
  background: var(--panel);
  color: var(--text);
  padding: 2.5rem;
  border-radius: 16px;
  width: 340px;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.login-card h1 { margin: 0; font-size: 1.5rem; }
.login-card label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; }

/* App layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  padding: 1.2rem 0;
}
.brand { font-weight: 700; font-size: 1.3rem; padding: 0 1.4rem 1rem; letter-spacing: .05em; }
.sidebar nav { display: flex; flex-direction: column; flex: 1; }
.nav-item {
  background: none;
  color: var(--muted);
  text-align: left;
  border-radius: 0;
  padding: .75rem 1.4rem;
}
.nav-item:hover { background: var(--panel); color: #fff; }
.nav-item.active { background: var(--panel-2); color: #fff; border-left: 3px solid var(--accent); }
.sidebar-footer {
  padding: 1rem 1.4rem 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.content { flex: 1; padding: 2rem; overflow: auto; }
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.view-header h2 { margin: 0; }
.toolbar { display: flex; gap: .6rem; align-items: center; }
.toolbar input { width: 260px; }

/* Table */
.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.data-table th, .data-table td { text-align: left; padding: .75rem 1rem; border-bottom: 1px solid #e2e8f0; font-size: .9rem; }
.data-table th { background: #f8fafc; color: var(--muted); font-weight: 600; }
.data-table tr:last-child td { border-bottom: none; }
.badge { padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge.ativo { background: #dcfce7; color: #166534; }
.badge.prospecto { background: #fef9c3; color: #854d0e; }
.badge.inativo { background: #f1f5f9; color: #64748b; }
.row-actions button { padding: .3rem .6rem; font-size: .8rem; margin-left: .3rem; }
.row-actions .del { background: var(--danger); }

.stub { background: #fff; padding: 2rem; border-radius: 12px; color: var(--muted); border: 1px dashed #cbd5e1; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 50; }
.modal-card { background: #fff; border-radius: 16px; padding: 1.8rem; width: 720px; max-width: 100%; max-height: 90vh; overflow: auto; }
.modal-card h3 { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.form-grid label { display: flex; flex-direction: column; gap: .3rem; font-size: .8rem; color: #475569; }
.col-span-2 { grid-column: 1 / -1; }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; }
