/* ── Globals ── */
* { margin:0; padding:0; box-sizing:border-box; }

body {
  background: #eef4fb;
  font-family: 'Nunito', sans-serif;
  color: #1e2d45;
  min-height: 100vh;
}

/* ── WRAP (Container) ── */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.page {
  width: 1200px;
  min-width: 1200px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 auto;
  padding: 14px 20px 40px;
}

/* ── NAV ── */
.nav {
  background: #fff;
  border-bottom: 1.5px solid #dde8f5;
  padding: 0 28px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(0,60,140,0.07);
  position: sticky;
  top: 0;
  z-index: 300;
  width: 100%;
}
.nav-logo {
  font-size: 18px;
  font-weight: 900;
  color: #1a4f8a;
  letter-spacing: -.02em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-logo em { color: #2272c3; font-style: normal; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nl {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: #7a90ac;
  text-decoration: none;
  transition: .15s;
  border: 1.5px solid transparent;
  white-space: nowrap;
}
.nl:hover { color: #1e2d45; background: #f4f8fd; }
.nl.on {
  background: #1a4f8a;
  color: #fff;
  border-color: #1a4f8a;
  box-shadow: 0 2px 8px rgba(26,79,138,0.25);
}
.nav-av {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg,#2272c3,#1a4f8a);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900; color: #fff; margin-left: 10px;
  cursor: pointer; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(26,79,138,0.25);
}
.nav-btn {
  margin-left: 8px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  background: #f4f8fd;
  color: #1a4f8a;
  border: 1.5px solid #dde8f5;
  cursor: pointer;
  transition: 0.15s;
}
.nav-btn:hover { background: #e8f0fb; border-color: #b0c8e8; }

/* ── PAGE HEADER ── */
.ph { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 14px; flex-wrap: wrap; }
.ph-title { font-size: 22px; font-weight: 900; line-height: 1.2; }
.ph-sub { font-size: 12px; color: #7a90ac; font-weight: 700; margin-top: 4px; }

/* ── CARD ── */
.card { background: #fff; border-radius: 16px; border: 1px solid #dde8f5; box-shadow: 0 2px 10px rgba(0,60,140,0.07); padding: 24px 32px; }

/* ── SECTION LABEL ── */
.slabel { font-size: 10px; font-weight: 900; color: #7a90ac; text-transform: uppercase; letter-spacing: .09em; display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.slabel::after { content: ''; flex: 1; height: 1px; background: #dde8f5; }

/* ── GRID ── */
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.g3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.g4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* ── FIELDS ── */
.f { display: flex; flex-direction: column; gap: 5px; }
.f label { font-size: 10px; font-weight: 900; color: #7a90ac; text-transform: uppercase; letter-spacing: .07em; }
.f input, .f select, .f textarea {
  padding: 10px 14px; border-radius: 10px; border: 1.5px solid #dde8f5;
  background: #f4f8fd; font-family: 'Nunito', sans-serif; font-size: 13px;
  font-weight: 700; color: #1e2d45; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.f input:focus, .f select:focus, .f textarea:focus {
  border-color: #2272c3; box-shadow: 0 0 0 3px rgba(34,114,195,.12); background: #fff;
}
.f input.err { border-color: #e5393a !important; }
.f textarea { resize: vertical; min-height: 72px; }
.emsg { font-size: 10px; font-weight: 800; color: #e5393a; display: none; margin-top: -1px; }

/* ── INPUT WITH UNIT ── */
.iuw { position: relative; display: flex; align-items: center; }
.iuw-input-wrap { position: relative; width: 100%; }
.iuw-input-wrap input { padding-right: 46px; width: 100%; }
.unit { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 800; color: #7a90ac; pointer-events: none; }
/* Cadastro variation */
.iuw-cad { position: relative; display: flex; align-items: center; }
.iuw-cad input { flex: 1; border-radius: 10px 0 0 10px; border-right: none !important; }
.iuw-cad input:focus { border-right: none !important; }
.iuw-unit { padding: 0 12px; height: 100%; display: flex; align-items: center; background: #f4f8fd; border: 1.5px solid #dde8f5; border-left: none; border-radius: 0 10px 10px 0; font-size: 12px; font-weight: 800; color: #7a90ac; white-space: nowrap; transition: border-color .15s; }
.iuw-cad:focus-within .iuw-unit { border-color: #2272c3; background: #fff; }

/* ── BUTTONS ── */
.actions { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 20px; border-radius: 10px; font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 800; cursor: pointer; border: none; transition: .16s; text-decoration: none; white-space: nowrap; }
.btn-p { background: #1a4f8a; color: #fff; box-shadow: 0 2px 8px rgba(26,79,138,0.25); }
.btn-p:hover { background: #153e6f; box-shadow: 0 4px 14px rgba(26,79,138,0.35); transform: translateY(-1px); }
.btn-s { background: #f4f8fd; color: #1e2d45; border: 1.5px solid #dde8f5; }
.btn-s:hover { border-color: #b0c8e8; background: #e8f0fb; }
.btn-d { background: #fff0f0; color: #e5393a; border: 1.5px solid #fcd0d0; }
.btn-d:hover { background: #ffe0e0; }
.btn-sm { padding: 5px 12px; font-size: 11px; border-radius: 8px; }

/* ── BADGE ── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 10.5px; font-weight: 800; }
.b-green { background: #e6f9f0; color: #22a06b; }
.b-yellow { background: #fff8e6; color: #f59e0b; }
.b-red { background: #fff0f0; color: #e5393a; }
.b-blue { background: #e8f0fb; color: #2272c3; }
.b-gray { background: #f4f8fd; color: #7a90ac; }

/* ── TOAST ── */
.toast { position: fixed; bottom: 28px; right: 28px; background: #22a06b; color: #fff; padding: 13px 20px; border-radius: 12px; font-size: 13px; font-weight: 800; box-shadow: 0 8px 30px rgba(0,40,120,0.18); transform: translateY(80px); opacity: 0; transition: all .35s cubic-bezier(.22,1,.36,1); display: flex; align-items: center; gap: 9px; z-index: 9999; pointer-events: none; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: #e5393a; }
.toast.info { background: #2272c3; }

/* ── LOADING OVERLAY ── */
.loader-overlay {
  position: fixed; inset: 0; background: rgba(255,255,255,0.8); z-index: 9999;
  display: flex; align-items: center; justify-content: center; opacity: 0;
  pointer-events: none; transition: opacity 0.2s;
}
.loader-overlay.active { opacity: 1; pointer-events: all; }
.spinner {
  width: 40px; height: 40px; border: 4px solid #dde8f5; border-top-color: #1a4f8a;
  border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── MOBILE RESPONSIVE ── */
@media(max-width:768px){
  .nav { padding: 0 14px; }
  .nl:not(.on){ display: none; }
  .wrap { padding: 12px 16px 48px; }
  .page { width: 100%; min-width: unset; max-width: 100%; gap: 8px; padding: 8px 10px; }
  .card { padding: 18px 16px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .ph { flex-direction: column; }
  .ph .btn { width: 100%; justify-content: center; }
  .actions { flex-direction: column-reverse; }
  .actions .btn { width: 100%; justify-content: center; }
}
