:root {
  --navy: #142D46;
  --navy-2: #1d3d5c;
  --orange: #F28B24;
  --gold: #D6B35C;
  --white: #FFFFFF;
  --bg: #f2f4f7;
  --card: #ffffff;
  --text: #1c2a38;
  --muted: #64748b;
  --border: #e2e8f0;
  --danger: #dc2626;
  --ok: #16a34a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar { background: var(--navy); color: #fff; }
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 24px; min-height: 60px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--orange), var(--gold));
  color: var(--navy); font-weight: 800; display: inline-flex;
  align-items: center; justify-content: center; font-size: 15px;
}
.brand-mark.big { width: 64px; height: 64px; font-size: 24px; margin: 0 auto 12px; }
.brand-name { font-size: 17px; letter-spacing: .3px; }
.brand-name b { color: var(--gold); }
.topnav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.topnav a {
  color: #dbe6f0; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 14px;
}
.topnav a:hover { background: rgba(255,255,255,.08); }
.topnav a.active { background: var(--orange); color: var(--navy); font-weight: 600; }
.userbox { display: flex; align-items: center; gap: 10px; font-size: 14px; margin-left: auto; }
.userbox-name { color: #dbe6f0; }

/* Layout */
.container { max-width: 1180px; margin: 0 auto; padding: 28px 20px; width: 100%; flex: 1; }
.footer { background: var(--navy); color: #9db2c4; font-size: 13px; margin-top: auto; }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 16px 20px; }

/* Cards / stats */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(16,24,40,.06);
}
.card-title { margin: 0 0 14px; font-size: 16px; color: var(--navy); }
.grid { display: grid; gap: 16px; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 20px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px; text-align: center;
}
.stat-value { font-size: 30px; font-weight: 800; color: var(--navy); display: block; }
.stat-label { color: var(--muted); font-size: 13px; }

.page-title { margin: 0 0 4px; color: var(--navy); font-size: 24px; }
.page-sub { color: var(--muted); margin: 0 0 22px; }

/* Tabela */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 600; }
.table code { background: #eef2f7; padding: 2px 6px; border-radius: 5px; }

/* Botões */
.btn-primary, .btn-ghost, .btn-danger {
  display: inline-block; text-decoration: none; border: 0; cursor: pointer;
  padding: 10px 18px; border-radius: 8px; font-size: 14px; font-weight: 600;
}
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary.full { width: 100%; }
.btn-ghost { background: transparent; color: var(--navy); border: 1px solid var(--border); }
.btn-danger { background: var(--danger); color: #fff; }

/* Formulários */
.form label { display: block; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
.form input, .form select {
  width: 100%; margin-top: 6px; padding: 11px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 15px; color: var(--text);
}
.form input:focus, .form select:focus { outline: 2px solid var(--orange); border-color: transparent; }

/* Alertas */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-success { background: #dcfce7; color: #14532d; }

/* Pills */
.pill { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.pill-ok { background: #dcfce7; color: #14532d; }
.pill-warn { background: #fef3c7; color: #92400e; }

.muted { color: var(--muted); }

/* Autenticação */
.auth-wrap { min-height: calc(100vh - 120px); display: flex; align-items: center; justify-content: center; padding: 30px 16px; }
.auth-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  padding: 36px; width: 100%; max-width: 420px; box-shadow: 0 20px 50px rgba(20,45,70,.12);
}
.auth-card.center { text-align: center; }
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-head h1 { margin: 0 0 6px; color: var(--navy); font-size: 22px; }
.auth-head h1 span { color: var(--orange); }
.auth-head p { color: var(--muted); margin: 0; font-size: 14px; }
.auth-foot { text-align: center; margin-top: 16px; }
.auth-foot a { color: var(--orange); text-decoration: none; font-size: 14px; }

@media (max-width: 640px) {
  .topbar-inner { gap: 12px; padding: 10px 14px; }
  .userbox { width: 100%; justify-content: flex-end; }
  .auth-card { padding: 26px; }
}
