:root {
  --pt-bg: #07151a;
  --pt-bg2: #0b2a2e;
  --pt-card: #f8fafc;
  --pt-ink: #0f172a;
  --pt-muted: #64748b;
  --pt-teal: #0d9488;
  --pt-teal-2: #14b8a6;
  --pt-line: rgba(255,255,255,.12);
  --pt-radius: 1.15rem;
  --pt-safe: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
#portalMain.portal-enter {
  animation: portal-enter .22s ease;
}
@keyframes portal-enter {
  from { opacity: .45; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.portal-tabbar[hidden] { display: none !important; }
.portal-body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(20,184,166,.35), transparent 50%),
    radial-gradient(800px 400px at 100% 0%, rgba(15,118,110,.4), transparent 45%),
    linear-gradient(165deg, #042f2e 0%, var(--pt-bg) 42%, #020617 100%);
  color: var(--pt-ink);
  padding-bottom: 0;
}
.portal-body.has-tabbar { padding-bottom: calc(5.4rem + var(--pt-safe)); }
.portal-top {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(4, 47, 46, .72);
  border-bottom: 1px solid var(--pt-line);
}
.portal-top-inner {
  max-width: 720px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(.85rem + env(safe-area-inset-top, 0px)) 1.15rem .85rem;
}
.portal-brand-block { display: flex; align-items: center; gap: .7rem; color: #ecfdf5; }
.portal-mark {
  width: 2.15rem; height: 2.15rem; border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(13,148,136,.35);
  overflow: hidden;
}
.portal-mark img { width: 100%; height: 100%; display: block; }
.portal-brand { font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.portal-sub { font-size: .8rem; color: #99f6e4; }
.portal-sair { color: #ccfbf1; text-decoration: none; font-size: .85rem; display: inline-flex; gap: .3rem; align-items: center; }
.portal-sair:hover { color: #fff; }
.portal-main { max-width: 720px; margin: 0 auto; padding: 1.1rem 1.1rem 1.5rem; }
.portal-page-title { color: #f8fafc; font-size: 1.35rem; font-weight: 700; margin: .2rem 0 1rem; }
.portal-hero { color: #f8fafc; margin-bottom: 1.1rem; }
.portal-hello { margin: 0; color: #99f6e4; font-size: .9rem; }
.portal-hero h1 { font-size: 1.55rem; font-weight: 750; margin: .15rem 0 0; }
.portal-card {
  background: var(--pt-card);
  border-radius: var(--pt-radius);
  box-shadow: 0 18px 40px rgba(0,0,0,.22);
  padding: 1.15rem 1.2rem;
  margin-bottom: 1rem;
}
.portal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.portal-action {
  display: flex; flex-direction: column; gap: .35rem;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 1rem;
  padding: .95rem .9rem; text-decoration: none; color: inherit;
  min-height: 6.4rem;
}
.portal-tab i, .portal-action i, .portal-icon {
  display: inline-flex;
  width: 1.35rem;
  height: 1.35rem;
}
.portal-action .portal-icon { width: 1.5rem; height: 1.5rem; color: var(--pt-teal); }
.portal-tab .portal-icon { width: 1.35rem; height: 1.35rem; }
.portal-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.portal-sair .portal-icon { width: 1.05rem; height: 1.05rem; }

.portal-flex { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.portal-flex-wrap { display: flex; flex-wrap: wrap; gap: .45rem; }
.portal-mb { margin-bottom: .85rem; }
.portal-mt { margin-top: .7rem; }
.portal-end { text-align: right; }
.portal-strong { font-weight: 700; }

label.portal-label, .portal-label {
  display: block;
  font-size: .82rem;
  font-weight: 650;
  color: #334155;
  margin: 0 0 .35rem;
}
.portal-field { margin-bottom: .85rem; }
.portal-input, .portal-select, .portal-textarea {
  width: 100%;
  border: 1px solid #ced4da;
  border-radius: .75rem;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-size: 1rem;
  padding: .65rem .8rem;
  min-height: 2.65rem;
}
.portal-textarea { min-height: 4.5rem; resize: vertical; }
.portal-input:focus, .portal-select:focus, .portal-textarea:focus, .portal-combo-toggle:focus, .portal-combo-search:focus {
  outline: 0;
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20,184,166,.18);
}
.portal-input.is-invalid, .portal-select.is-invalid, .portal-combo.is-invalid .portal-combo-toggle {
  border-color: #dc3545;
}
.portal-error { color: #b91c1c; font-size: .8rem; margin-top: .3rem; }
.portal-check { display: flex; align-items: center; gap: .45rem; font-size: .9rem; }
.portal-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.portal-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .7rem; }
@media (max-width: 520px) {
  .portal-row-3 { grid-template-columns: 1fr; }
}

.portal-combo { position: relative; }
.portal-combo-toggle {
  width: 100%;
  text-align: left;
  border: 1px solid #ced4da;
  border-radius: .75rem;
  background: #fff;
  color: #0f172a;
  font: inherit;
  padding: .65rem 2.1rem .65rem .8rem;
  min-height: 2.65rem;
  cursor: pointer;
  position: relative;
}
.portal-combo-toggle::after {
  content: "";
  position: absolute;
  right: .85rem;
  top: 50%;
  width: .45rem;
  height: .45rem;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: translateY(-70%) rotate(45deg);
}
.portal-combo-menu {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + .35rem);
  z-index: 40;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .85rem;
  box-shadow: 0 16px 32px rgba(15,23,42,.16);
  padding: .55rem;
  max-height: 16rem;
  display: none;
  flex-direction: column;
}
.portal-combo.is-open .portal-combo-menu { display: flex; }
.portal-combo-search {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: .6rem;
  padding: .5rem .65rem;
  font: inherit;
  margin-bottom: .4rem;
}
.portal-combo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  max-height: 12rem;
}
.portal-combo-list li {
  padding: .55rem .6rem;
  border-radius: .5rem;
  cursor: pointer;
  font-size: .92rem;
}
.portal-combo-list li:hover, .portal-combo-list li.is-active { background: #ccfbf1; color: #115e59; }
.portal-combo-list li.is-empty { color: #64748b; cursor: default; }

.portal-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .12rem .55rem;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  background: #e2e8f0;
  color: #334155;
}
.portal-badge.is-atrasada, .portal-badge.is-danger { background: #fee2e2; color: #991b1b; }
.portal-badge.is-aberta, .portal-badge.is-info { background: #dbeafe; color: #1e40af; }
.portal-badge.is-paga, .portal-badge.is-confirmada, .portal-badge.is-success { background: #dcfce7; color: #166534; }
.portal-badge.is-acordo, .portal-badge.is-pendente, .portal-badge.is-warning { background: #fef3c7; color: #92400e; }
.portal-w100 { width: 100%; justify-content: center; }
.portal-btn[disabled] { opacity: .7; }

[hidden] { display: none !important; }
.portal-action strong { font-size: .92rem; }
.portal-action span { font-size: .78rem; color: var(--pt-muted); }
.portal-action:hover { border-color: #5eead4; box-shadow: 0 8px 20px rgba(13,148,136,.12); }
.portal-chip {
  display: inline-flex; align-items: center;
  background: #ecfdf5; color: #115e59; border-radius: 999px;
  padding: .2rem .65rem; font-size: .75rem; margin: 0 .35rem .35rem 0;
}
.btn-teal, .portal-btn {
  background: var(--pt-teal); border: 0; color: #fff !important;
  border-radius: .8rem; padding: .65rem 1rem; font-weight: 600; text-decoration: none;
  display: inline-flex; align-items: center; gap: .35rem;
  font: inherit; cursor: pointer;
}
.btn-teal:hover, .portal-btn:hover { background: #0f766e; color: #fff; }
.portal-btn-ghost {
  background: transparent; color: #0f766e !important; border: 1px solid #99f6e4;
  border-radius: .8rem; padding: .55rem .9rem; text-decoration: none; font-weight: 600;
  display: inline-flex; align-items: center; font: inherit; cursor: pointer;
}
.portal-btn-ghost.is-active { border-color: #0d9488; background: #ecfdf5; }
.portal-row {
  display: flex; justify-content: space-between; gap: .7rem; align-items: center;
  padding: .85rem 0; border-bottom: 1px solid #e2e8f0;
}
.portal-row:last-child { border-bottom: 0; }
.portal-muted { color: var(--pt-muted); font-size: .85rem; }
.portal-alert { border-radius: .9rem; padding: .75rem .9rem; margin-bottom: .9rem; font-size: .9rem; }
.portal-alert-err { background: #fef2f2; color: #991b1b; }
.portal-alert-ok { background: #ecfdf5; color: #065f46; }
.portal-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(15, 23, 42, .94);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--pt-line);
  padding: .4rem 0 calc(.45rem + var(--pt-safe));
}
.portal-tab {
  color: #94a3b8; text-decoration: none; text-align: center;
  font-size: .68rem; font-weight: 600; padding: .25rem 0;
  display: flex; flex-direction: column; align-items: center; gap: .1rem;
}
.portal-tab i { font-size: 1.35rem; }
.portal-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, .58);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.portal-overlay[hidden] { display: none !important; }
.portal-overlay-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
  color: #ecfdf5;
  font-weight: 650;
  font-size: .95rem;
  letter-spacing: .02em;
}
.portal-overlay-spin {
  width: 2.25rem;
  height: 2.25rem;
  border: 3px solid rgba(204, 251, 241, .22);
  border-top-color: #5eead4;
  border-radius: 50%;
  animation: portal-spin .7s linear infinite;
}
.portal-tab.is-active { color: #5eead4; }
.portal-empty { color: var(--pt-muted); text-align: center; padding: 1.4rem .5rem; }
.form-control, .form-select { border-radius: .75rem; }
.portal-card .bootstrap-select { width: 100% !important; }
.portal-card .bootstrap-select > .dropdown-toggle {
  border-radius: .75rem;
  border: 1px solid #ced4da;
  background: #fff;
  color: #0f172a;
  min-height: calc(1.5em + .75rem + 2px);
}
.portal-card .bootstrap-select.is-invalid > .dropdown-toggle,
.portal-card .bootstrap-select .dropdown-toggle.is-invalid {
  border-color: #dc3545;
}
.portal-card .bootstrap-select .dropdown-menu {
  border-radius: .75rem;
  z-index: 50;
}
.portal-card .bs-searchbox .form-control { border-radius: .6rem; }
.portal-card .invalid-feedback { font-size: .8rem; }
@media (min-width: 640px) {
  .portal-grid { grid-template-columns: repeat(4, 1fr); }
}

.portal-install-slot { margin-top: .85rem; }
.portal-install-card {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: calc(5.5rem + var(--pt-safe));
  z-index: 45;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  gap: .85rem;
  align-items: flex-start;
  background: #f8fafc;
  color: #0f172a;
  border-radius: 1.15rem;
  padding: 1rem 1.05rem .95rem;
  box-shadow: 0 18px 40px rgba(0,0,0,.28);
}
.portal-install-card.is-inline {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  max-width: none;
  margin: 0;
  box-shadow: 0 18px 40px rgba(0,0,0,.22);
}
.portal-install-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #5eead4, #0f766e);
  color: #042f2e;
  font-size: 1.35rem;
}
.portal-install-body { flex: 1; min-width: 0; padding-right: 1.2rem; }
.portal-install-body strong { display: block; font-size: .98rem; margin-bottom: .2rem; }
.portal-install-body p { margin: 0 0 .7rem; font-size: .82rem; color: #64748b; line-height: 1.4; }
.portal-install-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.portal-install-actions .portal-btn,
.portal-install-actions .portal-btn-ghost { padding: .45rem .8rem; font-size: .82rem; }
.portal-install-close {
  position: absolute;
  top: .45rem;
  right: .5rem;
  width: 1.85rem;
  height: 1.85rem;
  border: 0;
  border-radius: 999px;
  background: #ecfdf5;
  color: #0f766e;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.portal-install-close:hover { background: #0d9488; color: #fff; }
.portal-install-chip {
  position: fixed;
  right: 1rem;
  bottom: calc(5.5rem + var(--pt-safe));
  z-index: 45;
  border: 0;
  border-radius: 999px;
  background: #0d9488;
  color: #fff;
  padding: .4rem .45rem .4rem .85rem;
  font-size: .82rem;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  box-shadow: 0 10px 24px rgba(0,0,0,.28);
}
.portal-install-chip-open {
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .15rem .15rem .15rem 0;
  cursor: pointer;
}
.portal-install-chip-x {
  width: 1.55rem;
  height: 1.55rem;
  border: 0;
  border-radius: 999px;
  background: rgba(4, 47, 46, .28);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.portal-install-chip-x:hover { background: rgba(4, 47, 46, .5); }
.portal-install-chip:hover { background: #0f766e; }
.portal-install-chip i { font-size: 1.15rem; }
body:not(.has-tabbar) .portal-install-card:not(.is-inline),
body:not(.has-tabbar) .portal-install-chip {
  bottom: calc(1.15rem + var(--pt-safe));
}
body:not(.has-tabbar) .portal-install-chip { display: none; }

.portal-btn-spinner {
  display: inline-block;
  width: .95rem;
  height: .95rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: portal-spin .55s linear infinite;
  flex-shrink: 0;
  vertical-align: -2px;
}
@keyframes portal-spin {
  to { transform: rotate(360deg); }
}
[data-portal-aguarde="1"],
.is-waiting {
  pointer-events: none !important;
  opacity: .82;
  cursor: wait;
}
.portal-btn.is-waiting,
.portal-btn-ghost.is-waiting,
.portal-sair.is-waiting,
.portal-tab.is-waiting,
.portal-action.is-waiting {
  justify-content: center;
}
.portal-action.is-waiting {
  flex-direction: row;
  align-items: center;
  gap: .45rem;
}
.portal-tab.is-waiting {
  flex-direction: row;
  gap: .3rem;
  font-size: .72rem;
}
.portal-infinite-sent { height: 1px; }
.portal-infinite-hint {
  margin: .45rem 0 0;
  text-align: center;
  color: var(--pt-muted);
  font-size: .8rem;
}
