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

:root {
  --rb-bg: #eef2f6;
  --rb-surface: #ffffff;
  --rb-ink: #142033;
  --rb-muted: #637189;
  --rb-primary: #0047bb;
  --rb-primary-dark: #003892;
  --rb-line: #d9e0ea;
  --rb-accent: #00a8b8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  background:
    radial-gradient(circle at 8% 0%, #d5e3ff 0%, rgba(213, 227, 255, 0) 36%),
    radial-gradient(circle at 88% 100%, #d2f8ff 0%, rgba(210, 248, 255, 0) 34%),
    var(--rb-bg);
  color: var(--rb-ink);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── NAVBAR ──────────────────────────────────────── */
.topbar {
  width: 100%;
  padding: 0 32px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--rb-ink);
  position: sticky;
  top: 0;
  z-index: 100;
  border-top: 3px solid var(--rb-primary);
}

.nb-brand {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #f0a500;
  white-space: nowrap;
  min-width: 120px;
}

.nb-nav {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: center;
  gap: 0;
}

.nb-right {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 120px;
  justify-content: flex-end;
}

.app-menu { background: transparent; }

.menu-btn {
  width: auto;
  margin: 0;
  padding: 18px 14px;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: rgba(255,255,255,0.75);
  font-family: inherit;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}

.menu-btn:hover {
  color: #fff;
}

.menu-btn.active {
  color: #f0a500;
  border-bottom-color: #f0a500;
  background: none;
}

.user-pill {
  color: rgba(255,255,255,0.65);
  font-size: 12px;
  background: none;
  border: none;
  padding: 0;
}

.logout-link {
  text-decoration: none;
  color: rgba(255,255,255,0.85);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  transition: color .15s;
}

.logout-link:hover {
  color: #fff;
}

.layout {
  max-width: 1220px;
  margin: 24px auto 24px;
  padding: 0 12px;
  display: block;
  flex: 1;
}

/* ── FOOTER ───────────────────────────────────────── */
.site-footer {
  background: var(--rb-ink);
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 20px 24px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  border-bottom: 3px solid var(--rb-primary);
  margin-top: auto;
}

.card {
  background: var(--rb-surface);
  border: 1px solid var(--rb-line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 20px rgba(20, 32, 51, 0.05);
}

.panel { display: none; }
.panel.active { display: block; }

.cadastro-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.cadastro-form,
.cadastro-preview {
  flex: 1;
}

.label-preview {
  max-width: 520px;
  background: #fff;
  padding: 10px 0;
}

.login-card {
  max-width: 420px;
  margin: 72px auto;
}

.brand-login {
  position: relative;
  overflow: hidden;
}

.brand-login::before {
  content: "";
  position: absolute;
  inset: -40% auto auto -20%;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 71, 187, 0.18) 0%, rgba(0, 71, 187, 0) 70%);
  pointer-events: none;
}

h1, h2 {
  margin: 0 0 12px 0;
  letter-spacing: 0.2px;
}

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

label {
  font-size: 12px;
  color: #33425c;
  margin-bottom: 4px;
  font-weight: 600;
}

input, select, button {
  width: 100%;
  padding: 9px;
  margin-bottom: 10px;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  font-size: 13px;
  font-family: "Montserrat", sans-serif;
}

input:focus,
select:focus {
  outline: none;
  border-color: #7ea8ec;
  box-shadow: 0 0 0 3px rgba(0, 71, 187, 0.1);
}

button {
  background: linear-gradient(135deg, var(--rb-primary) 0%, #0c66de 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: linear-gradient(135deg, var(--rb-primary-dark) 0%, #0a57bc 100%);
}

button[style*="background: #d32f2f"]:hover {
  background: #b71c1c !important;
}

.button-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.button-group button {
  margin-bottom: 0;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th, td {
  padding: 8px;
  border-bottom: 1px solid #ecf1f7;
  text-align: left;
  white-space: nowrap;
}

thead th {
  color: #33425c;
  font-weight: 700;
  background: #f7faff;
}

.flash {
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 12px;
}

.flash.error { background: #ffebee; color: #c62828; }
.flash.ok { background: #e8f5e9; color: #2e7d32; }

@media (max-width: 900px) {
  .topbar {
    height: auto;
    flex-wrap: wrap;
    padding: 10px 16px;
    gap: 8px;
  }

  .nb-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .cadastro-layout {
    grid-template-columns: 1fr;
  }

  .login-card {
    margin: 36px 12px;
  }
}

.btn-edit-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--rb-primary);
  padding: 4px 7px;
  border-radius: 6px;
  vertical-align: middle;
  transition: color .15s;
}
.btn-edit-row:hover { color: var(--rb-primary-dark); }
.btn-edit-row svg { display: block; }

.btn-del-row {
  background: none;
  border: none;
  color: #d9363e;
  border-radius: 6px;
  padding: 4px 7px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  transition: background .15s, color .15s;
}
.btn-del-row:hover {
  background: #d9363e;
  color: #fff;
}
.btn-del-row svg {
  display: block;
}
