:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --bg: #f4f6fb;
  --card-bg: #ffffff;
  --border: #e5e7eb;
  --muted: #6b7280;
  --text: #0f172a;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
.boot { padding: 40px; text-align: center; color: var(--muted); }

/* ---- Auth screens (Login/Esqueci/Reset/Convite) ---- */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(140deg, #eef2ff 0%, #f4f6fb 60%);
}
.auth-card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 32px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow);
}
.auth-brand {
  text-align: center;
  margin-bottom: 24px;
}
.auth-brand h1 {
  margin: 0;
  font-size: 22px;
  color: var(--primary);
  letter-spacing: -0.3px;
}
.auth-brand p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.auth-card h2 {
  margin: 0 0 18px;
  font-size: 18px;
  color: var(--text);
}
.auth-card .field { margin-bottom: 14px; }
.auth-card label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 500;
}
.auth-card input[type=email],
.auth-card input[type=password],
.auth-card input[type=text] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: white;
  transition: border-color .15s, box-shadow .15s;
}
.auth-card input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.auth-card .btn {
  width: 100%;
  padding: 11px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.auth-card .btn:hover { background: var(--primary-dark); }
.auth-card .btn:disabled { background: #94a3b8; cursor: not-allowed; }
.auth-card .btn.secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--border);
}
.auth-card .btn.secondary:hover { background: #f8fafc; }
.auth-card .link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  margin-top: 12px;
  text-decoration: underline;
}
.auth-card .err {
  background: #fee2e2;
  color: #991b1b;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
}
.auth-card .ok {
  background: #dcfce7;
  color: #166534;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
}
.auth-card .hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

/* ---- Painel ---- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.topbar .brand {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
}
.topbar .who { color: var(--muted); font-size: 13px; }
.topbar .who strong { color: var(--text); }
.topbar .logout {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
}
.topbar .logout:hover { background: #f8fafc; color: var(--text); }

.tabs {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
}
.tabs button {
  background: transparent;
  border: none;
  padding: 12px 16px;
  font-size: 14px;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tabs button.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.tabs button:hover:not(.active) { color: var(--text); }

.content { padding: 24px; max-width: 1100px; width: 100%; margin: 0 auto; }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.card {
  background: white;
  border-radius: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
}
.card .label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 500;
}
.card .value {
  font-size: 20px;
  font-weight: 700;
  margin-top: 4px;
  color: var(--text);
}
.card .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card.danger .value { color: var(--danger); }
.card.warning .value { color: var(--warning); }
.card.success .value { color: var(--success); }

.table-wrap {
  background: white;
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 18px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table th, table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
table th {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
table tbody tr:last-child td { border-bottom: none; }
table tbody tr:hover { background: #f8fafc; }
table .num { text-align: right; font-variant-numeric: tabular-nums; }
table .nowrap { white-space: nowrap; }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #f3f4f6;
  color: #374151;
}
.badge.success { background: #dcfce7; color: #166534; }
.badge.warning { background: #fef3c7; color: #92400e; }
.badge.danger  { background: #fee2e2; color: #991b1b; }
.badge.info    { background: #dbeafe; color: #1e40af; }

.btn-sm {
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
}
.btn-sm:hover { background: #f1f5f9; }
.btn-sm.primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn-sm.primary:hover { background: var(--primary-dark); }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 30px;
  font-size: 13px;
}
.section-title {
  font-size: 16px;
  margin: 0 0 12px;
  color: var(--text);
}

.bloqueio-bar {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 13px;
  color: #92400e;
}
.bloqueio-bar.danger {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

@media (max-width: 600px) {
  .content { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .tabs { padding: 0 8px; }
  table th, table td { padding: 8px 10px; font-size: 12px; }
}
