.gestor-app {
  --rj-ink: #0B1C2C;
  --rj-navy: #0F2A4A;
  --rj-steel: #1F4B6E;
  --rj-amber: #C47A0A;
  --rj-amber-soft: #FFF4E0;
  --rj-cloud: #EEF2F7;
  --rj-muted: #5A6B7D;
  --rj-card: #FFFFFF;
  --rj-line: #D8E0EA;
  --rj-success: #0F7A3A;
  --rj-success-soft: #E6F6EC;
  --rj-danger: #B42318;
  --rj-danger-soft: #FDECEC;
  --g-nav-h: 56px;
  --g-top-h: 56px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  background: var(--rj-cloud);
  color: var(--rj-ink);
  font-family: 'Roboto', sans-serif;
}

.gestor-app #gestor-shell {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  background: var(--rj-cloud);
}

.g-status {
  height: var(--safe-t);
  background: var(--rj-navy);
  flex-shrink: 0;
}

.g-topbar {
  display: flex;
  align-items: center;
  height: var(--g-top-h);
  padding: 0 16px;
  background: var(--rj-navy);
  flex-shrink: 0;
}

.g-topbar-title {
  flex: 1;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.g-topbar-user {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  margin-right: 12px;
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.g-topbar-sair {
  border: none;
  background: none;
  color: var(--rj-amber);
  font-weight: 700;
  font-size: 15px;
  padding: 8px;
  cursor: pointer;
}

.g-topbar-back {
  border: none;
  background: none;
  color: #fff;
  font-size: 22px;
  padding: 4px 10px 4px 0;
  cursor: pointer;
  line-height: 1;
}

.g-banners { flex-shrink: 0; }

.g-banner {
  padding: 12px 16px;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.g-banner-danger { background: var(--rj-danger); }
.g-banner-amber { background: var(--rj-amber); }

.g-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--g-nav-h) + var(--safe-b) + 8px);
}

.g-content.no-nav { padding-bottom: calc(var(--safe-b) + 16px); }

.g-page { padding: 16px 16px 0; }

.g-page-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  color: var(--rj-ink);
}

.g-page-title.navy { color: var(--rj-navy); }

.g-page-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--rj-muted);
}

.g-list { padding: 12px 16px 16px; }

.g-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--rj-card);
  border: 1px solid var(--rj-line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
  box-shadow: none;
}

.g-card-static {
  background: var(--rj-card);
  border: 1px solid var(--rj-line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 10px;
}

.g-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.g-card-tipo {
  font-size: 16px;
  font-weight: 700;
  color: var(--rj-ink);
}

.g-card-meta {
  margin-top: 6px;
  font-size: 13px;
  color: var(--rj-muted);
}

.g-card-valor {
  margin-top: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--rj-navy);
}

.g-card-data {
  margin-top: 4px;
  font-size: 12px;
  color: var(--rj-muted);
}

.g-card-text {
  font-size: 15px;
  color: var(--rj-ink);
  line-height: 1.45;
  white-space: pre-line;
}

.g-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.g-badge-warn { background: var(--rj-amber-soft); color: var(--rj-amber); }
.g-badge-ok { background: var(--rj-success-soft); color: var(--rj-success); }
.g-badge-danger { background: var(--rj-danger-soft); color: var(--rj-danger); }
.g-badge-info { background: #E8F0F8; color: var(--rj-steel); }

.g-bottomnav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--rj-line);
  padding-bottom: constant(safe-area-inset-bottom);
  padding-bottom: var(--safe-b);
  min-height: var(--g-nav-h);
  height: auto;
}

.g-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  background: none;
  color: var(--rj-muted);
  font-size: 11px;
  font-weight: 500;
  padding: 8px 2px 6px;
  min-height: var(--g-nav-h);
  cursor: pointer;
  position: relative;
}

.g-nav-item.active { color: var(--rj-navy); font-weight: 600; }

.g-nav-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 28px;
  border-radius: 16px;
}

.g-nav-item.active .g-nav-icon-wrap {
  background: rgba(15, 42, 74, 0.12);
}

.g-nav-item .material-symbols-rounded {
  font-size: 22px;
}

.g-nav-badge {
  position: absolute;
  top: -2px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--rj-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.g-btn-outline {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  border: 1px solid var(--rj-navy);
  border-radius: 12px;
  background: #fff;
  color: var(--rj-navy);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.g-btn-primary {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  border: none;
  border-radius: 12px;
  background: var(--rj-navy);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.g-btn-success {
  background: var(--rj-success);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px;
  width: 100%;
  font-weight: 600;
  margin-top: 12px;
  cursor: pointer;
  font-family: inherit;
}

.g-opcao {
  padding: 12px 16px;
  border-radius: 12px;
  margin-top: 10px;
  cursor: pointer;
  border: 1px solid var(--rj-line);
  background: #fff;
}

.g-opcao:first-of-type { margin-top: 16px; }

.g-opcao.active {
  background: var(--rj-navy);
  border-color: var(--rj-navy);
  color: #fff;
}

.g-opcao.active .g-opcao-sub { color: rgba(255,255,255,0.7); }

.g-opcao-title { font-size: 16px; font-weight: 700; }

.g-opcao-sub { font-size: 12px; color: var(--rj-muted); margin-top: 2px; }

.g-lista-titulo {
  margin-top: 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--rj-ink);
}

.g-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--rj-muted);
}

.g-swipe-card {
  position: relative;
  overflow: hidden;
  margin-bottom: 10px;
  border-radius: 14px;
}

.g-swipe-card .g-card { margin-bottom: 0; transition: transform 0.15s ease; }

.g-alert-qr {
  background: var(--rj-amber);
  color: #fff;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
  border-radius: 14px;
}

.g-fab {
  position: fixed;
  right: 16px;
  bottom: calc(var(--g-nav-h) + var(--safe-b) + 16px);
  z-index: 45;
  width: 56px;
  height: 56px;
  border-radius: 28px;
  border: none;
  background: var(--rj-navy);
  color: #fff;
  font-size: 32px;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(15, 42, 74, 0.35);
  cursor: pointer;
  font-family: inherit;
}

.g-form-page {
  padding: 16px;
  padding-bottom: calc(var(--safe-b) + 24px);
}

.g-form-page .field { margin-bottom: 12px; }

.g-form-page .field input,
.g-form-page .field select,
.g-form-page .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--rj-line);
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
}

.g-form-page .field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--rj-muted);
  margin-bottom: 4px;
}

.g-form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  font-size: 14px;
}

.g-btn-danger-sm {
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid var(--rj-danger);
  border-radius: 10px;
  background: #fff;
  color: var(--rj-danger);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.g-card-clickable { cursor: pointer; }

.g-card-clickable:active { opacity: 0.85; }

.g-bottomnav[hidden] { display: none !important; }

.g-bloqueio {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(24px + var(--safe-t)) 24px calc(24px + var(--safe-b));
  background: var(--rj-navy);
  color: #fff;
  text-align: center;
}
.g-bloqueio h1 { margin: 0 0 12px; font-size: 24px; }
.g-bloqueio p { margin: 0 0 24px; color: #C9D7E8; line-height: 1.45; font-size: 15px; }
.g-bloqueio .btn {
  background: var(--rj-amber);
  color: #0B1C2C;
  border: none;
  font-weight: 700;
}

@media (min-width: 768px) {
  .gestor-app #gestor-shell {
    max-width: 480px;
    margin: 0 auto;
    box-shadow: 0 0 40px rgba(0,0,0,0.08);
  }
  .g-bottomnav {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
  }
  .g-fab {
    right: calc(50% - 240px + 16px);
  }
}
