@import url('toast.css');

:root {
  --green-dark: #0b6b3f;
  --green: #0f9d58;
  --text: #1a1f1c;
  --text-secondary: #5f6d66;
  --text-muted: #7a8680;
  --wallpaper: url('../img/wallpaper.png');
  --bg: transparent;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-glass: rgba(255, 255, 255, 0.82);
  --bg-glass-strong: rgba(255, 255, 255, 0.94);
  --header-glass: rgba(255, 255, 255, 0.48);
  --header-glass-border: rgba(255, 255, 255, 0.42);
  --glass-border: rgba(255, 255, 255, 0.72);
  --shadow: 0 4px 24px rgba(15, 60, 35, 0.1);
  --shadow-sm: 0 2px 10px rgba(15, 60, 35, 0.08);
  --radius-lg: 20px;
  --radius-md: 14px;
  --page-pad: 14px;
  --nav-height: 62px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
  min-height: 100%;
  background-color: #d4ebe0;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: transparent;
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
  touch-action: manipulation;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
textarea,
select {
  font-size: 16px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--wallpaper) center top / cover no-repeat;
  background-attachment: fixed;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.38) 0%,
    rgba(236, 247, 241, 0.55) 42%,
    rgba(255, 255, 255, 0.48) 100%
  );
}

.glass-surface {
  background: var(--bg-glass) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.phone {
  width: 100%;
  max-width: 100%;
  min-height: 100dvh;
  max-height: 100dvh;
  background: transparent;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header — barra neutra (sem verde) */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding: calc(8px + var(--safe-top)) var(--page-pad) 8px;
  background: var(--header-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--header-glass-border);
  position: relative;
  z-index: 200;
}

.brand__row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand__logo {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.brand__name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.brand__tagline {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.lang-picker {
  position: relative;
  flex-shrink: 0;
  z-index: 210;
}

.lang-picker__btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green-dark);
  border: 1px solid #e8eeea;
  font-size: 17px;
}

.lang-picker__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 168px;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 60, 35, 0.18);
  border: 1px solid var(--glass-border);
  padding: 6px;
  z-index: 300;
}

.lang-picker__menu.hidden {
  display: none;
}

.lang-picker__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.lang-picker__item:hover {
  background: #eef2ef;
}

.lang-picker__item.is-active {
  background: #eef2ef;
  color: var(--green-dark);
}

.auth-top .lang-picker {
  margin-left: auto;
}

.auth-top .lang-picker__menu {
  right: 0;
}

.notify-btn__badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 7px;
  background: var(--green);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--bg-card);
}

/* Main — conteúdo rola; espaço para o menu fixo no rodapé */
.main-scroll {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px var(--page-pad) calc(76px + var(--safe-bottom));
  min-height: 0;
  position: relative;
  z-index: 1;
}

/* Balance card */
.balance-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 12px;
  min-height: 132px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.65) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
}

.balance-card__visual {
  position: absolute;
  right: 0;
  bottom: 0;
  top: 0;
  width: auto;
  max-width: 48%;
  height: 100%;
  object-fit: contain;
  object-position: right center;
  pointer-events: none;
  filter: drop-shadow(0 6px 16px rgba(15, 60, 35, 0.12));
  background: transparent;
}

.balance-card__content {
  position: relative;
  z-index: 1;
  padding: 14px 12px 12px;
  max-width: 60%;
}

.balance-card__label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.balance-card__label svg {
  width: 13px;
  height: 13px;
  opacity: 0.7;
}

.balance-card__amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--green-dark);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s;
}

@keyframes balanceMiningPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.88; }
}

.balance-card__amount.balance-live {
  color: var(--green);
  animation: balanceMiningPulse 1.2s ease-in-out infinite;
}

.balance-mining-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 4px;
  animation: balanceMiningPulse 0.8s ease-in-out infinite;
}

.balance-badge--mining {
  color: var(--green-dark) !important;
}

.balance-card__mining {
  font-size: 9px;
  color: var(--green);
  margin-top: 4px;
  font-weight: 500;
}

.carteira-balance-lg.balance-live {
  color: var(--green);
  animation: balanceMiningPulse 1.2s ease-in-out infinite;
}

.balance-card__yield-label {
  font-size: 9px;
  color: var(--text-secondary);
  margin-bottom: 1px;
}

.balance-card__yield-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 6px;
}

.balance-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 9px;
  font-weight: 600;
  color: var(--green);
}

.balance-card__badge svg {
  width: 9px;
  height: 9px;
}

/* Quick actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.quick-action {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 6px 2px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease;
}

.quick-action:active {
  transform: scale(0.97);
}

.quick-action__img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 36px;
}

.quick-action__img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(15, 60, 35, 0.1));
}

.quick-action__label {
  font-size: 9px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  line-height: 1.2;
}

.page-head--with-lang {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  position: relative;
  z-index: 200;
}

.page-head--with-lang .page-head__main {
  flex: 1;
  min-width: 0;
}

/* Section */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.section-head__title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-head__link {
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
}

/* Fund cards */
.fund-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fund-card {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 8px;
  align-items: center;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 10px;
  box-shadow: var(--shadow-sm);
}

.fund-card__thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: #dce5e0;
}

.fund-card__name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1px;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fund-card__location {
  font-size: 9px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.fund-card__meta dt {
  font-size: 8px;
  color: var(--text-muted);
  margin-bottom: 0;
}

.fund-card__meta dd {
  font-size: 11px;
  font-weight: 700;
}

.fund-card__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}

.fund-card__stats {
  text-align: right;
}

.fund-card__stats dt {
  font-size: 7px;
  color: var(--text-muted);
}

.fund-card__stats dd {
  font-size: 9px;
  font-weight: 700;
  margin-bottom: 3px;
  line-height: 1.2;
}

.fund-card__stats dd:last-of-type {
  margin-bottom: 0;
}

.fund-card__stats dd.yield {
  color: var(--green);
  font-size: 8px;
  font-weight: 600;
}

.btn-investir {
  background: var(--green);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(15, 157, 88, 0.3);
}

.btn-investir:active {
  opacity: 0.9;
}

/* Bottom nav — fixo no rodapé do ecrã (PWA standalone / Android) */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 100%;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--glass-border);
  padding: 6px 4px calc(6px + var(--safe-bottom));
  z-index: 200;
  box-sizing: border-box;
}

/* PWA instalada: altura do ecrã sem cortar o menu */
html.is-standalone .phone,
html.is-pwa .phone {
  min-height: 100%;
  max-height: none;
  height: 100%;
}

html.is-standalone,
html.is-pwa {
  height: 100%;
}

html.is-standalone body,
html.is-pwa body {
  min-height: 100%;
  height: 100%;
  overflow: hidden;
}

.bottom-nav__items {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 6px 5px;
  color: var(--text-muted);
  position: relative;
  min-width: 0;
  flex: 1;
}

.nav-item svg {
  width: 20px;
  height: 20px;
}

.nav-item span {
  font-size: 9px;
  font-weight: 500;
}

.nav-item--active {
  color: var(--green);
}

.nav-item--active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--green);
}

/* Pages */
.page-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.page-sub { font-size: 11px; color: var(--text-secondary); margin-bottom: 14px; }
.empty-msg { font-size: 12px; color: var(--text-muted); text-align: center; padding: 24px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.stat-card {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  box-shadow: var(--shadow-sm);
}
.stat-card span { display: block; font-size: 9px; color: var(--text-muted); margin-bottom: 4px; }
.stat-card strong { font-size: 13px; color: var(--green-dark); }
.stat-card--wide { margin-bottom: 14px; }
.wallet-item, .yield-row, .mov-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  padding: 12px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}
.wallet-item__img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.wallet-item__val, .yield-row__val, .mov-row__amt { margin-left: auto; text-align: right; font-size: 12px; font-weight: 700; }
.wallet-item small, .yield-row small { color: var(--text-secondary); font-size: 9px; }
.profile-card { background: var(--bg-card); border-radius: var(--radius-md); padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.profile-card p { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #eef2ef; font-size: 13px; }
.profile-card span { color: var(--text-secondary); }
.fund-card--full { grid-template-columns: 1fr; }
.fund-card__desc { font-size: 10px; color: var(--text-secondary); margin-bottom: 6px; }
.btn-investir--block { width: 100%; margin-top: 8px; }

/* Auth */
.auth-body { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--bg); }
.auth-card { width: 100%; max-width: 380px; background: var(--bg-card); border-radius: var(--radius-lg); padding: 28px 22px; box-shadow: var(--shadow); }
.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-brand h1 { font-size: 22px; color: var(--green-dark); }
.auth-brand p { font-size: 12px; color: var(--text-secondary); }
.auth-form label { display: block; font-size: 12px; margin-bottom: 12px; color: var(--text-secondary); }
.auth-form input, .auth-form textarea { width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid #dce5e0; border-radius: 10px; font: inherit; }
.auth-error { color: #c0392b; font-size: 12px; min-height: 18px; }
.auth-footer { text-align: center; margin-top: 16px; font-size: 12px; }
.auth-footer a { color: var(--green); font-weight: 600; }
.inova-btn-primary { width: 100%; padding: 12px; background: var(--green); color: #fff; border: none; border-radius: 12px; font-weight: 600; font-size: 14px; cursor: pointer; }
.inova-btn-outline { width: 100%; padding: 12px; background: transparent; color: var(--green-dark); border: 1px solid var(--green); border-radius: 12px; font-weight: 600; cursor: pointer; }

/* Payment UI + animations */
.inova-pay-open { overflow: hidden; }
.inova-pay-loading { align-items: center; }
.inova-pay-modal, .inova-invest-sheet { align-items: flex-end; }
.inova-pay-loading, .inova-pay-modal, .inova-invest-sheet { position: fixed; inset: 0; z-index: 200; display: flex; justify-content: center; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.inova-pay-loading.is-open, .inova-pay-modal.is-open, .inova-invest-sheet.is-open { pointer-events: auto; opacity: 1; visibility: visible; }
.inova-pay-loading-backdrop, .inova-pay-modal-backdrop, .inova-sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); backdrop-filter: blur(4px); }
.inova-pay-loading-card { position: relative; z-index: 1; background: #fff; border-radius: 20px; padding: 28px 32px; text-align: center; animation: inovaPop .35s ease; }
.inova-pay-spinner { width: 44px; height: 44px; margin: 0 auto 12px; border: 3px solid #e8eeea; border-top-color: var(--green); border-radius: 50%; animation: inovaSpin .8s linear infinite; }
.inova-pay-loading-title { font-weight: 700; font-size: 15px; }
.inova-pay-loading-sub { font-size: 12px; color: var(--text-secondary); }
.inova-sheet-panel, .inova-pay-modal-panel { position: relative; z-index: 1; width: 100%; max-width: 480px; max-height: 92dvh; overflow-y: auto; background: #fff; border-radius: 24px 24px 0 0; padding: 22px 18px calc(18px + var(--safe-bottom)); animation: inovaSlideUp .35s cubic-bezier(.22,1,.36,1); }
.inova-sheet-close, .inova-pay-close { position: absolute; top: 12px; right: 14px; width: 32px; height: 32px; border: none; background: #f0f4f2; border-radius: 50%; font-size: 20px; cursor: pointer; }
.inova-sheet-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; padding-right: 36px; }
.inova-sheet-sub { font-size: 11px; color: var(--text-secondary); margin-bottom: 14px; }
.inova-field-label, .inova-sheet-label { font-size: 11px; color: var(--text-secondary); margin-bottom: 6px; display: block; }
.inova-field-input { width: 100%; padding: 12px; font-size: 20px; font-weight: 700; border: 2px solid #e8eeea; border-radius: 12px; margin-bottom: 6px; }
.inova-sheet-hint { font-size: 11px; color: var(--green); margin-bottom: 14px; }
.inova-pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.inova-pay-method { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; border: 2px solid #e8eeea; border-radius: 14px; background: #fff; cursor: pointer; transition: transform .2s, border-color .2s, box-shadow .2s; font-size: 11px; font-weight: 600; }
.inova-pay-method:hover { transform: translateY(-2px); }
.inova-pay-method.is-selected { border-color: var(--green); box-shadow: 0 4px 16px rgba(15,157,88,.2); animation: inovaPulse 1.5s ease infinite; }
.inova-pay-method__icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; }
.inova-pay-method__icon--pix { background: linear-gradient(135deg,#00bdae,#008744); color: #fff; font-size: 11px; }
.inova-pay-method__icon--usdt { background: linear-gradient(135deg,#26a17b,#1a7a5c); color: #fff; }
.inova-pay-method__icon--btc { background: linear-gradient(135deg,#f7931a,#e2761b); color: #fff; }
.inova-pay-qr-wrap { display: flex; justify-content: center; margin: 12px 0; }
.inova-pay-copy-row { display: flex; gap: 8px; margin: 10px 0; }
.inova-pay-copy-row.hidden { display: none; }
.inova-pay-copy-input { flex: 1; font-size: 11px; padding: 8px; border-radius: 8px; border: 1px solid #dce5e0; }
.inova-pay-copy-btn { padding: 8px 12px; background: var(--green); color: #fff; border: none; border-radius: 8px; font-size: 12px; cursor: pointer; }
@keyframes inovaSpin { to { transform: rotate(360deg); } }
@keyframes inovaSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes inovaPop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes inovaPulse { 0%,100% { box-shadow: 0 4px 16px rgba(15,157,88,.2); } 50% { box-shadow: 0 6px 24px rgba(15,157,88,.35); } }

.page-error-state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 16px; text-align: center; }
.page-error-retry { width: auto; min-width: 140px; padding-inline: 20px; }

/* Admin */
.hidden { display: none !important; }
.admin-body { background: transparent; min-height: 100dvh; }
.admin-login .auth-card { background: var(--bg-glass-strong); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.admin-login { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.admin-app { display: flex; min-height: 100dvh; }
.admin-sidebar { width: 220px; background: #0b6b3f; color: #fff; padding: 20px 12px; flex-shrink: 0; }
.admin-sidebar nav { display: flex; flex-direction: column; gap: 6px; margin-top: 20px; }
.admin-sidebar button { text-align: left; padding: 10px 12px; border: none; background: transparent; color: rgba(255,255,255,.8); border-radius: 8px; cursor: pointer; font: inherit; }
.admin-sidebar button.active, .admin-sidebar button:hover { background: rgba(255,255,255,.15); color: #fff; }
.admin-main { flex: 1; padding: 24px; overflow: auto; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--bg-glass-strong); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: 12px; overflow: hidden; margin-top: 16px; font-size: 12px; border: 1px solid var(--glass-border); }
.admin-table th, .admin-table td { padding: 10px; border-bottom: 1px solid #eef2ef; text-align: left; vertical-align: middle; }
.admin-inv-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.admin-filter {
  padding: 8px 14px;
  border: 1px solid #dce5e0;
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
}
.admin-filter.is-active { background: var(--green); color: #fff; border-color: var(--green); }
.admin-status { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.admin-status--pending { background: #fff3cd; color: #856404; }
.admin-status--paid { background: #d4edda; color: #155724; }
.admin-status--cancelled { background: #f8d7da; color: #721c24; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-btn-approve { padding: 6px 10px; border-radius: 6px; border: none; background: var(--green); color: #fff; font-size: 11px; font-weight: 600; cursor: pointer; }
.admin-btn-reject { padding: 6px 10px; border-radius: 6px; border: 1px solid #dce5e0; background: #fff; color: #c0392b; font-size: 11px; font-weight: 600; cursor: pointer; }
.admin-form { background: var(--bg-glass-strong); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 16px; border-radius: 12px; margin-bottom: 16px; border: 1px solid var(--glass-border); }
.admin-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.admin-form label { display: block; font-size: 11px; margin-bottom: 8px; }
.admin-check-label { display: flex !important; align-items: center; gap: 8px; font-size: 13px !important; margin-top: 8px; }
.admin-check-label input { width: auto; margin: 0; }
.admin-form input, .admin-form textarea { width: 100%; padding: 8px; border: 1px solid #dce5e0; border-radius: 8px; font: inherit; margin-top: 4px; }
.admin-danger {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid #f5c6cb;
  border-radius: 12px;
  padding: 20px;
  max-width: 560px;
}
.admin-danger h3 { margin: 0 0 10px; color: #c0392b; font-size: 16px; }
.admin-danger ul { margin: 0 0 12px 18px; font-size: 13px; color: #444; }
.admin-danger-note { font-size: 12px; color: #666; margin: 0 0 8px; }
.admin-danger-warn { font-size: 13px; font-weight: 700; color: #c0392b; margin: 0 0 14px; }
.admin-danger-confirm { display: block; font-size: 12px; margin-bottom: 12px; }
.admin-danger-confirm input {
  display: block;
  width: 100%;
  max-width: 280px;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid #dce5e0;
  border-radius: 8px;
  font: inherit;
}
.admin-danger-confirm code { background: #f8f0f0; padding: 2px 6px; border-radius: 4px; }
.admin-btn-danger {
  padding: 12px 18px;
  border: none;
  border-radius: 8px;
  background: #c0392b;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.admin-btn-danger:disabled { opacity: 0.6; cursor: not-allowed; }
.admin-purge-result { font-size: 13px; color: #155724; margin-top: 12px; }

/* Admin — suporte / chat */
.admin-support-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 16px;
  min-height: 480px;
  margin-top: 8px;
}

.admin-support-threads {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  overflow: hidden;
  max-height: 560px;
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
}

.admin-thread-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border: none;
  border-bottom: 1px solid #eef2ef;
  background: transparent;
  cursor: pointer;
  font: inherit;
  transition: background 0.15s;
}

.admin-thread-item:hover,
.admin-thread-item.is-active {
  background: rgba(15, 157, 88, 0.08);
}

.admin-thread-item.is-active {
  border-left: 3px solid var(--green);
  padding-left: 13px;
}

.admin-thread-item strong {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: #1a1f1c;
}

.admin-thread-item span {
  display: block;
  font-size: 11px;
  color: #5f6d66;
  margin-top: 3px;
}

.admin-thread-item small {
  display: block;
  font-size: 11px;
  color: #8b9590;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-thread-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e74c3c;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.admin-support-chat {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  min-height: 480px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.admin-support-chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #eef2ef;
  background: rgba(255, 255, 255, 0.5);
}

.admin-support-chat__head-main {
  min-width: 0;
  flex: 1;
}

.admin-support-chat__head strong {
  display: block;
  font-size: 15px;
  color: #1a1f1c;
}

.admin-support-chat__meta {
  display: block;
  font-size: 11px;
  color: #5f6d66;
  margin-top: 2px;
  font-weight: 500;
}

.admin-btn-close-thread {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  background: #fff5f5;
  color: #c0392b;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.admin-btn-close-thread:hover {
  background: #fdecea;
  border-color: #e74c3c;
}

.admin-support-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 300px;
  background: rgba(248, 251, 249, 0.65);
}

.admin-support-chat__composer {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid #eef2ef;
  background: rgba(255, 255, 255, 0.85);
}

.admin-support-chat__composer input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid #dce5e0;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  background: #fff;
}

.admin-support-chat__composer input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(15, 157, 88, 0.12);
}

.admin-chat-send {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-chat-send:hover {
  background: var(--green-dark);
}

.admin-chat-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.admin-chat-bubble__text {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-chat-bubble time {
  display: block;
  font-size: 10px;
  margin-top: 5px;
  opacity: 0.72;
}

.admin-chat-bubble--user {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e8eeea;
  border-bottom-left-radius: 4px;
}

.admin-chat-bubble--admin {
  align-self: flex-end;
  background: linear-gradient(135deg, #0f9d58, #0b6b3f);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.admin-support-empty {
  padding: 32px 20px;
  text-align: center;
  color: #8b9590;
  font-size: 13px;
  line-height: 1.5;
}

/* Admin dashboard expandido */
.admin-app { max-width: 1480px; margin: 0 auto; width: 100%; }
.admin-sidebar {
  width: 268px;
  display: flex;
  flex-direction: column;
}
.admin-sidebar nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.admin-sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.admin-theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.92);
  user-select: none;
}
.admin-theme-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.admin-theme-toggle__track {
  flex-shrink: 0;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  position: relative;
  transition: background 0.2s;
}
.admin-theme-toggle__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.admin-theme-toggle input:checked + .admin-theme-toggle__track {
  background: rgba(255, 255, 255, 0.35);
}
.admin-theme-toggle input:checked + .admin-theme-toggle__track::after {
  transform: translateX(18px);
}
.admin-theme-toggle__label { line-height: 1.35; }
.admin-branding-box {
  max-width: 520px;
  margin-bottom: 28px;
  padding: 20px;
  border-radius: 14px;
  background: var(--bg-glass-strong);
  border: 1px solid var(--glass-border);
}

.admin-form--inline-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.admin-form--inline-brand label {
  flex: 1;
  min-width: 220px;
  margin-bottom: 0;
}

.admin-form--inline-brand .inova-btn-primary {
  width: auto;
  min-width: 140px;
  flex-shrink: 0;
}
.admin-dash-head { margin-bottom: 22px; }
.admin-dash-head h2 { font-size: 26px; margin-bottom: 4px; }
.admin-dash-sub { font-size: 13px; color: var(--text-secondary); }
.admin-section-title {
  font-size: 14px;
  font-weight: 700;
  margin: 24px 0 12px;
  color: var(--text);
}
.admin-cashflow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 8px;
}
.admin-cashflow-card {
  border-radius: 16px;
  padding: 20px 18px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
}
.admin-cashflow-card--in {
  background: linear-gradient(145deg, #0b6b3f 0%, #0f9d58 100%);
}
.admin-cashflow-card--out {
  background: linear-gradient(145deg, #8b3a2a 0%, #c0392b 100%);
}
.admin-cashflow-card--current {
  background: linear-gradient(145deg, #1a3d5c 0%, #2471a3 100%);
}
.admin-cashflow-card__label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.88;
  margin-bottom: 8px;
}
.admin-cashflow-card__value {
  display: block;
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 10px;
}
.admin-cashflow-card__break {
  list-style: none;
  font-size: 12px;
  opacity: 0.92;
  line-height: 1.6;
}
.admin-cashflow-card__hint {
  font-size: 11px;
  opacity: 0.85;
  margin: 0;
  line-height: 1.4;
}
.admin-stats--dash {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.admin-main .stat-card {
  padding: 16px 14px;
  border-radius: 14px;
}
.admin-main .stat-card span { font-size: 10px; }
.admin-main .stat-card strong { font-size: 15px; }
.admin-table--dash { font-size: 13px; }
.admin-table--dash th,
.admin-table--dash td { padding: 12px 14px; }
.admin-amt--pos { color: var(--green-dark); font-weight: 700; }
.admin-amt--neg { color: #c0392b; font-weight: 700; }

/* Tema escuro (app utilizador + admin) */
[data-theme="dark"] {
  --text: #e8eeea;
  --text-secondary: #a8b5ae;
  --text-muted: #8b9590;
  --bg-card: rgba(22, 32, 28, 0.92);
  --bg-glass: rgba(18, 28, 24, 0.82);
  --bg-glass-strong: rgba(14, 22, 18, 0.94);
  --header-glass: rgba(12, 20, 16, 0.72);
  --header-glass-border: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}
[data-theme="dark"] html {
  background-color: #0a1210;
}
[data-theme="dark"] body::after {
  background: linear-gradient(
    180deg,
    rgba(8, 14, 12, 0.72) 0%,
    rgba(12, 22, 18, 0.82) 42%,
    rgba(6, 12, 10, 0.78) 100%
  );
}
[data-theme="dark"] .app-header,
[data-theme="dark"] .balance-card,
[data-theme="dark"] .quick-action,
[data-theme="dark"] .fund-card,
[data-theme="dark"] .wallet-card,
[data-theme="dark"] .profile-card,
[data-theme="dark"] .auth-card,
[data-theme="dark"] .inova-sheet-panel,
[data-theme="dark"] .inova-pay-modal-panel,
[data-theme="dark"] .inova-pay-loading-card {
  color: var(--text);
}
[data-theme="dark"] .inova-sheet-panel,
[data-theme="dark"] .inova-pay-modal-panel,
[data-theme="dark"] .inova-pay-loading-card,
[data-theme="dark"] .inova-pay-method,
[data-theme="dark"] .inova-field-input,
[data-theme="dark"] .inova-pay-copy-input {
  background: #1a2622;
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text);
}
[data-theme="dark"] .inova-sheet-close,
[data-theme="dark"] .inova-pay-close {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}
[data-theme="dark"] .bottom-nav {
  background: rgba(14, 22, 18, 0.94);
  border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .admin-table th,
[data-theme="dark"] .admin-table td {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .admin-filter {
  background: #1a2622;
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
}
[data-theme="dark"] .admin-form input,
[data-theme="dark"] .admin-form textarea,
[data-theme="dark"] .admin-btn-reject {
  background: #1a2622;
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text);
}
[data-theme="dark"] .admin-chat-bubble--user {
  background: #1a2622;
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text);
}
[data-theme="dark"] .admin-danger ul { color: var(--text-secondary); }
[data-theme="dark"] .stat-card strong { color: #5dd39e; }
[data-theme="dark"] .admin-amt--pos { color: #5dd39e; }

@media (max-width: 1100px) {
  .admin-cashflow { grid-template-columns: 1fr; }
  .admin-stats--dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .admin-app { flex-direction: column; max-width: none; }
  .admin-sidebar { width: 100%; }
  .admin-sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .admin-sidebar-footer { margin-top: 12px; }
  .admin-main { padding: 20px 16px 32px; }
  .admin-stats--dash { grid-template-columns: 1fr 1fr; }
  .admin-support-layout { grid-template-columns: 1fr; }
  .admin-support-threads { max-height: 220px; }
  .admin-support-chat { min-height: 360px; }
}

/* Admin modal — utilizador / utilitários */
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.admin-modal.is-open {
  display: flex;
}
.admin-modal.hidden {
  display: none !important;
}
.admin-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.admin-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  max-height: 90dvh;
  overflow-y: auto;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  padding: 20px;
  box-shadow: var(--shadow);
}
.admin-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.admin-modal__head h3 {
  margin: 0;
  font-size: 18px;
}
.admin-modal__close {
  border: none;
  background: #eef2ef;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.admin-modal__actions {
  margin-top: 12px;
}
.admin-subsection-title {
  font-size: 13px;
  font-weight: 700;
  margin: 16px 0 8px;
}
.admin-form-hint {
  font-size: 11px;
  color: var(--text-secondary);
  margin: 8px 0 0;
}
.admin-code-block {
  font-size: 11px;
  background: #f4f7f5;
  border-radius: 8px;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}
.admin-payout-dest {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  max-width: 280px;
}
.admin-payout-dest__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.admin-payout-dest__value {
  display: block;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
  white-space: pre-wrap;
  line-height: 1.35;
  padding: 6px 8px;
  border-radius: 8px;
  background: #f4f7f5;
  color: var(--text);
}
.admin-payout-copy {
  padding: 3px 8px;
  border: none;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  color: var(--green-dark);
  background: rgba(15, 157, 88, 0.12);
}
.admin-payout-copy:hover {
  background: rgba(15, 157, 88, 0.2);
}
.admin-mini-list {
  max-height: 200px;
  overflow-y: auto;
}
.admin-mini-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  padding: 8px 0;
  border-bottom: 1px solid #eef2ef;
  font-size: 11px;
}
.admin-mini-row strong {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
}
.admin-mini-row small {
  grid-column: 1;
  color: var(--text-muted);
}
.admin-btn-edit {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #dce5e0;
  background: #fff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: var(--green-dark);
}
[data-theme="dark"] .admin-code-block {
  background: #1a2622;
}
[data-theme="dark"] .admin-payout-dest__value {
  background: #1a2622;
}
[data-theme="dark"] .admin-btn-edit {
  background: #1a2622;
  border-color: rgba(255, 255, 255, 0.12);
}
