/* ════════════════════════════════════════════════════════════════
   KAIRON — Design System 2.0
   Dark · Glassmorphism · Gradient accents
   ════════════════════════════════════════════════════════════════ */

/* ── Fontes ────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Lexend:wght@500;600;700;800&display=swap');

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { min-height: 100%; min-width: 320px; scroll-behavior: smooth; overflow-x: hidden; }

/* ── Variáveis ─────────────────────────────────────── */
:root {
  /* superfícies */
  --bg: #07070d;
  --surface: rgba(24,21,38,.82);
  --surface2: rgba(15,13,24,.78);
  --border: rgba(255,255,255,.09);
  --border2: rgba(255,255,255,.06);
  --card: #171426;
  --card2: #100e1c;

  /* texto */
  --text: #f1f0f8;
  --muted: #9694ad;

  /* estado */
  --ok: #34e0a1;
  --good: #34e0a1;
  --bad: #fb7185;
  --warn: #fbbf24;

  /* marca */
  --accent: #8b5cf6;
  --accent2: #22d3ee;
  --accent3: #ec4899;
  --gradient: linear-gradient(135deg, #8b5cf6 0%, #7c6cf8 38%, #22d3ee 100%);
  --gradient-soft: linear-gradient(135deg, rgba(139,92,246,.16), rgba(34,211,238,.12));
  --glow: 0 0 0 1px rgba(139,92,246,.10), 0 8px 30px rgba(139,92,246,.14);

  --header-h: 68px;
  --radius: 16px;
  --radius-sm: 11px;
}

body {
  font-family: 'Manrope', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-top: var(--header-h);
  line-height: 1.5;
}

/* fundo animado: mesh de gradiente fixo atrás de tudo */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--bg);
}
body::after {
  content: '';
  position: fixed;
  inset: -10%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38% 32% at 12% 8%,  rgba(139,92,246,.24), transparent 70%),
    radial-gradient(32% 30% at 92% 14%, rgba(34,211,238,.16), transparent 70%),
    radial-gradient(40% 36% at 80% 92%, rgba(236,72,153,.13), transparent 70%),
    radial-gradient(30% 30% at 6% 88%,  rgba(99,102,241,.16), transparent 70%);
  filter: blur(10px);
  animation: meshFloat 22s ease-in-out infinite alternate;
}
@keyframes meshFloat {
  0%   { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(-1.5%, 1.5%, 0) scale(1.05); }
}
@media (prefers-reduced-motion: reduce) { body::after { animation: none; } }

body.login-page { padding-top: 0 !important; display: flex; align-items: center; justify-content: center; min-height: 100vh; }

a, a:visited, a:hover, a:active { color: inherit; text-decoration: none; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }
input[type="number"] { -moz-appearance: textfield; }

::selection { background: rgba(139,92,246,.38); color: #fff; }

/* ── Header ────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(12,10,20,.62);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 22px;
  z-index: 1000;
  gap: 16px;
}
.site-header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--gradient);
  opacity: .55;
}

.header-logo img {
  height: 40px;
  display: block;
  filter: drop-shadow(0 0 14px rgba(139,92,246,.45));
  transition: filter .2s;
}
.header-logo:hover img { filter: drop-shadow(0 0 20px rgba(139,92,246,.7)); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
}

.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--muted);
  transition: color .15s, background .2s, box-shadow .2s;
  position: relative;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,.06); }
.nav-link.nav-active {
  color: #fff;
  background: var(--gradient);
  box-shadow: 0 4px 18px rgba(139,92,246,.4);
}

.nav-logout {
  margin-left: 4px;
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  transition: all .15s;
}
.nav-logout:hover { color: var(--bad); border-color: rgba(251,113,133,.5); background: rgba(251,113,133,.08); }

.nav-mobile-row { display: contents; }

/* ── Hamburger ─────────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: auto;
  padding: 6px;
  border-radius: 10px;
}
.hamburger:hover { background: rgba(255,255,255,.06); }
.hamburger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Nav overlay mobile ────────────────────────────── */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4,3,8,.72);
  backdrop-filter: blur(4px);
  z-index: 998;
}
.nav-overlay.show { display: block; }

/* ── Footer ────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 30px 16px;
  color: var(--muted);
  font-size: 13px;
  margin-top: 40px;
  border-top: 1px solid var(--border2);
}

/* ── Modal ─────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4,3,10,.68);
  backdrop-filter: blur(6px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.show { display: flex; animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box,
.modal-scroll {
  max-height: 90vh;
  overflow-y: auto;
}
.modal-box {
  /* SEM backdrop-filter: modais por vezes têm pickers/dropdowns
     position:fixed lá dentro — mesma nota do .card acima. */
  /* Fundo sólido próprio (não usa var(--surface), que é semi-transparente
     e é partilhada por outros elementos como .card) */
  background: rgb(24, 21, 38);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  min-width: 260px;
  text-align: center;
  box-shadow: var(--glow), 0 24px 60px rgba(0,0,0,.55);
  animation: modalPop .18s ease;
  position: relative;
  overflow: hidden;
}
/* Fio de gradiente no topo — assinatura visual comum a todos os modais */
.modal-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient);
  opacity: .9;
}
@keyframes modalPop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-box p { font-size: 16px; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.modal-btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  font-weight: 700;
  transition: all .15s;
}
.modal-btn:hover { border-color: rgba(139,92,246,.5); transform: translateY(-1px); }
.modal-btn-danger { border-color: rgba(251,113,133,.35); color: var(--bad); }
.modal-btn-danger:hover { background: rgba(251,113,133,.1); border-color: var(--bad); }

/* ── Cabeçalho de modal (ícone + título + fechar) ──────────────────
   Utilitário genérico para modais "com formulário" em vez de simples
   caixas de confirmação — usar dentro de .modal-box com text-align:left. */
.modal-head {
  display: flex; align-items: center; gap: 12px;
  text-align: left; margin-bottom: 18px;
}
.modal-icon {
  flex: 0 0 42px; width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff;
  background: var(--gradient-soft);
  border: 1px solid rgba(139,92,246,.35);
}
.modal-head-text { flex: 1 1 auto; min-width: 0; }
.modal-title { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.modal-subtitle { font-size: 12px; color: var(--muted); margin-top: 2px; }
.modal-close {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  color: var(--muted); cursor: pointer; font-size: 13px;
  transition: all .15s;
}
.modal-close:hover { color: var(--bad); border-color: rgba(251,113,133,.4); background: rgba(251,113,133,.08); }

/* ── Utilitários comuns ────────────────────────────── */
.page-wrap { max-width: 1100px; margin: 0 auto; padding: 28px 16px 60px; }

.card,
.gestao-card,
.inv-card,
.s-card,
.m-card {
  /* SEM backdrop-filter aqui de propósito: esta classe é reutilizada
     por toda a app, incluindo em páginas que colocam dropdowns/pickers
     position:fixed lá dentro (ex.: o picker de ícones das Despesas
     Fixas). Um backdrop-filter aqui criava um novo containing block
     para esses fixed, prendendo-os às dimensões do cartão em vez do
     ecrã — o mesmo bug que já apanhámos no header. Compensa-se com
     --surface um pouco mais opaco (definido no :root). */
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--glow);
  transition: border-color .2s, transform .2s;
}
.card-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(34,211,238,.4);
  background: var(--gradient-soft);
  color: var(--text);
  cursor: pointer;
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 700;
  letter-spacing: -.01px;
  transition: box-shadow .15s ease, transform .15s ease;
  white-space: nowrap;
}
.btn i, .btn svg { pointer-events: none; }
.btn:hover {
  box-shadow: 0 0 0 3px rgba(34,211,238,.18);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0) scale(.98); }



.btn-danger { border-color: rgba(251,113,133,.3); color: var(--bad); background: rgba(251,113,133,.05); }
.btn-danger:hover { background: rgba(251,113,133,.12); border-color: var(--bad); box-shadow: 0 6px 18px rgba(251,113,133,.18); }

.btn-primary {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 18px rgba(139,92,246,.35);
}
.btn-primary:hover {
  background: var(--gradient);
  border-color: transparent;
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 8px 26px rgba(139,92,246,.5);
}

.btn-icon { padding: 10px 12px; }

/* ── Field label ────────────────────────────────────────────────── */
.field-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}

/* ── Field input — estilo ciano (mesmo aspeto que .vd-input) ──────
   Os !important vencem resets nativos de <input> e estilos
   injectados por páginas sem contexto de formulário.
   ─────────────────────────────────────────────────────────────── */
.field-input {
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 9px 12px !important;
  border: 1px solid rgba(34,211,238,.4) !important;
  background: var(--gradient-soft) !important;
  border-radius: 10px !important;
  color: var(--text) !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  font-family: inherit !important;
  outline: none !important;
  transition: box-shadow .15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.field-input::placeholder { color: var(--muted); font-weight: 600; }
.field-input:focus {
  box-shadow: 0 0 0 3px rgba(34,211,238,.18) !important;
}
.field-input:disabled,
.field-input[readonly] { opacity: .5; cursor: not-allowed; pointer-events: none; }

select.field-input {
  cursor: pointer;
  /* combina gradient-soft (background-image é a última camada) + seta ciana */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2322d3ee'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"),
    linear-gradient(135deg, rgba(139,92,246,.16), rgba(34,211,238,.12)) !important;
  background-repeat: no-repeat, no-repeat !important;
  background-position: right 10px center, center !important;
  background-size: 18px, cover !important;
  padding-right: 34px !important;
}
textarea.field-input { resize: vertical; }

.page-title {
  font-family: 'Lexend', 'Manrope', sans-serif;
  font-size: 24px; font-weight: 800; letter-spacing: -.4px;
  background: linear-gradient(90deg, #fff, #cfc9ff 65%, #b7f0ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.page-sub   { font-size: 13px; color: var(--muted); margin-top: 3px; }

.sep { border: none; border-top: 1px solid var(--border2); margin: 14px 0; }

/* ── Login page ────────────────────────────────────── */
.login-box {
  width: 100%;
  max-width: 400px;
  padding: 48px 40px;
  background: var(--surface);
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: 22px;
  margin: 20px 16px;
  box-shadow: var(--glow), 0 30px 80px rgba(0,0,0,.5);
  position: relative;
  z-index: 1;
}
.login-logo { display: flex; justify-content: center; margin-bottom: 28px; }
.login-logo img { height: 56px; filter: drop-shadow(0 0 22px rgba(139,92,246,.5)); }
.login-box h2 {
  font-family: 'Lexend', sans-serif;
  font-size: 25px; font-weight: 800; margin-bottom: 6px; text-align: center; letter-spacing: -.3px;
}
.login-box .login-tag { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.login-error { color: var(--bad); font-size: 13px; text-align: center; margin-bottom: 14px; background: rgba(251,113,133,.1); border: 1px solid rgba(251,113,133,.3); border-radius: 10px; padding: 10px 12px; }
.login-field { margin-bottom: 14px; }

.login-box input[type="password"] {
  display: block !important;
  width: 100% !important;
  padding: 14px 16px !important;
  border-radius: 13px !important;
  border: 1px solid var(--border) !important;
  background: var(--surface2) !important;
  color: var(--text) !important;
  font-size: 16px !important;
  font-family: inherit !important;
  outline: none !important;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.login-box input[type="password"]:focus { border-color: rgba(139,92,246,.6) !important; box-shadow: 0 0 0 4px rgba(139,92,246,.14) !important; }

.login-submit {
  display: block;
  width: 100%;
  padding: 15px;
  border-radius: 13px;
  border: none;
  background: var(--gradient);
  color: #fff;
  font-size: 16px;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
  margin-top: 22px;
  transition: transform .15s, box-shadow .15s;
  letter-spacing: -.1px;
  box-shadow: 0 8px 24px rgba(139,92,246,.4);
}
.login-submit:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(139,92,246,.55); }
.login-submit:active { transform: translateY(0); }

@media (max-width: 480px) {
  .login-box {
    padding: 38px 26px;
    border-radius: 18px;
    margin: 16px 12px;
  }
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 1160px) {
  .hamburger { display: flex; }

  .main-nav {
    position: fixed;
    top: var(--header-h);
    right: 0;
    left: auto;
    bottom: 0;
    width: 280px;
    max-width: 82vw;
    background: rgba(12,10,20,.88);
    backdrop-filter: blur(26px) saturate(160%);
    -webkit-backdrop-filter: blur(26px) saturate(160%);
    border-left: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 14px 16px 24px;
    gap: 4px;
    overflow-y: auto;
    transform: translateX(110%);
    visibility: hidden;
    pointer-events: none;
    transition: transform .28s cubic-bezier(.4,0,.2,1), visibility .28s;
    z-index: 999;
  }
  .main-nav.open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .nav-link { padding: 13px 14px; font-size: 15.5px; border-radius: 12px; }
  .nav-link.nav-active { box-shadow: 0 4px 18px rgba(139,92,246,.3); }
  .nav-logout { margin-left: 0; margin-top: 8px; padding: 13px 14px; width: 100%; justify-content: center; display: flex; border-radius: 12px; }

  .nav-mobile-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; margin-top: 8px; }
  .nav-mobile-row.nav-mobile-row--single { grid-template-columns: 1fr; }
  .nav-mobile-row .nav-logout,
  .nav-mobile-row .nav-apps-wrap { width: auto; min-width: 0; margin: 0; }
  .nav-mobile-row .nav-apps-btn { width: 100%; height: 100%; margin: 0; border-radius: 12px; }
}

/* ── Nav com ícones ────────────────────────────────────────────── */
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.nav-icon { font-size: 14px; flex-shrink: 0; }

.main-nav.icons-only .nav-label { display: none; }
.main-nav.icons-only .nav-link  { padding: 8px 11px; }
.main-nav.icons-only .nav-icon  { font-size: 16px; }

@media (max-width: 1160px) {
  .main-nav.icons-only .nav-label { display: inline; }
  .main-nav.icons-only .nav-link  { padding: 13px 14px; }
}

/* ── Forms — glow violeta ──────────────────────────────────────── */
form:not(.card form):not(.ea-form form):not(.modal-box form):not(.form-inline):not(.login-box form) {
  background: var(--surface);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--glow);
}

/* ── Scrollbar global ──────────────────────────────────────────── */
::-webkit-scrollbar { width:5px; height:5px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg,#8b5cf6,#22d3ee); border-radius:999px; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg,#a378ff,#4fe4ff); }
* { scrollbar-width:thin; scrollbar-color:#8b5cf6 transparent; }

/* ── textarea base (sem classe) — estilo ciano ──────────────────
   Garante que <textarea> soltas (sem .field-input nem .vd-input)
   seguem o mesmo aspeto visual.
   ─────────────────────────────────────────────────────────────── */
textarea:not([class]) {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid rgba(34,211,238,.4);
  background: var(--gradient-soft);
  border-radius: 10px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  resize: vertical;
  transition: box-shadow .15s ease;
}
textarea:not([class])::placeholder { color: var(--muted); font-weight: 600; }
textarea:not([class]):focus {
  box-shadow: 0 0 0 3px rgba(34,211,238,.18);
}

/* ════════════════════════════════════════════════════════════════
   INPUTS CIANO — variante .vd-input
   Usar em formulários que seguem o tema accent2 (#22d3ee).
   Aplica-se a: input, textarea, select com a classe .vd-input.
   ════════════════════════════════════════════════════════════════ */

/* ── Base ────────────────────────────────────────────────────── */
.vd-input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid rgba(34,211,238,.4);
  background: var(--gradient-soft);
  border-radius: 10px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  transition: box-shadow .15s ease;
  -webkit-appearance: none;
  appearance: none;
}

/* ── Placeholder ─────────────────────────────────────────────── */
.vd-input::placeholder {
  color: var(--muted);
  font-weight: 600;
}

/* ── Focus ───────────────────────────────────────────────────── */
.vd-input:focus {
  box-shadow: 0 0 0 3px rgba(34,211,238,.18);
}

/* ── Disabled / readonly ─────────────────────────────────────── */
.vd-input:disabled,
.vd-input[readonly] {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Textarea ────────────────────────────────────────────────── */
textarea.vd-input {
  resize: vertical;
  min-height: 90px;
}

/* ── Select ──────────────────────────────────────────────────── */
select.vd-input {
  cursor: pointer;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2322d3ee'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"),
    linear-gradient(135deg, rgba(139,92,246,.16), rgba(34,211,238,.12));
  background-repeat: no-repeat, no-repeat;
  background-position: right 10px center, center;
  background-size: 18px, cover;
  padding-right: 34px;
}

/* ── Date ────────────────────────────────────────────────────── */
input[type="date"].vd-input {
  color-scheme: dark;
  cursor: pointer;
}

/* ── Number — sem setas ──────────────────────────────────────── */
input[type="number"].vd-input {
  -moz-appearance: textfield;
}
input[type="number"].vd-input::-webkit-outer-spin-button,
input[type="number"].vd-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ── Date input — ícone calendário ──────────────────────────────── */
input[type="date"] { color-scheme: dark; }
input[type="date"]::-webkit-calendar-picker-indicator {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M19 4h-1V2h-2v2H8V2H6v2H5C3.9 4 3 4.9 3 6v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V10h14v10zm0-12H5V6h14v2z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: .75;
  cursor: pointer;
  color: transparent;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* ── Fade-in genérico para conteúdo de página ───────────────────── */
main { animation: pageIn .25s ease; }
@keyframes pageIn { from { opacity:0; transform: translateY(6px);} to { opacity:1; transform:none; } }

/* ════════════════════════════════════════════════════════════════
   KAIRON 3.0 — Estrutura: Sidebar (desktop) + Bottom Tabs (mobile)
   ════════════════════════════════════════════════════════════════ */

body.k3 { padding-top: 0; }

/* ── Sidebar (desktop) ─────────────────────────────────────────── */
.kside {
  position: fixed; top: 0; left: 0; bottom: 0; width: 252px;
  background: rgba(12,10,20,.62);
  backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
}
.kside::-webkit-scrollbar { width: 3px; }

.kside-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 14px;
  flex-shrink: 0;
}
.kside-brand img { height: 50px; filter: drop-shadow(0 0 14px rgba(139,92,246,.45)); }

.kside-nav { flex: 1; padding: 6px 12px 12px; display: flex; flex-direction: column; gap: 16px; }
.kside-group-title {
  font-size: 10.5px; font-weight: 800; color: var(--muted); text-transform: uppercase;
  letter-spacing: .09em; padding: 0 10px; margin-bottom: 6px;
}
.kside-group { display: flex; flex-direction: column; gap: 2px; }
.kside-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 11px;
  font-size: 13.5px; font-weight: 700; color: var(--muted);
  transition: background .15s, color .15s;
  position: relative;
}
.kside-link i { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }
.kside-link:hover { color: var(--text); background: rgba(255,255,255,.05); }
.kside-link.active { color: #fff; background: var(--gradient); box-shadow: 0 4px 16px rgba(139,92,246,.35); }
.kside-link .kside-badge {
  margin-left: auto; font-size: 10px; font-weight:800; padding: 2px 7px; border-radius: 999px;
  background: rgba(139,92,246,.18); color:#d9d0ff;
}

.kside-foot { flex-shrink: 0; padding: 12px; border-top: 1px solid var(--border2); display: flex; flex-direction: column; gap: 4px; }
.kside-foot .kside-link { font-size: 13px; }

/* área principal desloca-se para a direita da sidebar */
.kmain { margin-left: 252px; min-height: 100vh; }

/* ── Topbar leve (desktop, dentro da área principal) ─────────────── */
.ktopbar {
  position: sticky; top: 0; z-index: 500;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 26px;
  background: rgba(7,7,13,.55);
  backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid var(--border2);
}
.ktopbar-search {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  color: var(--muted); font-size: 13px; font-weight:600;
  max-width: 340px; width: 100%;
  cursor: pointer;
}
.ktopbar-search:hover { border-color: rgba(139,92,246,.4); }
.ktopbar-actions { display:flex; align-items:center; gap:8px; flex-shrink:0; }

/* ── Sidebar mobile (drawer) ──────────────────────────────────────*/
.kside-hamburger { display:none; }

@media (max-width: 980px) {
  .kside { transform: translateX(-100%); transition: transform .28s cubic-bezier(.4,0,.2,1); box-shadow: 0 0 60px rgba(0,0,0,.6); }
  .kside.open { transform: translateX(0); }
  .kmain { margin-left: 0; padding-bottom: 74px; }
  .kside-hamburger {
    display:flex; align-items:center; justify-content:center;
    width:38px; height:38px; border-radius:10px; border:none; background:rgba(255,255,255,.05);
    color:var(--text); cursor:pointer; text-decoration:none; flex-shrink:0;
  }
}

/* ── Bottom tab bar (mobile) ──────────────────────────────────────*/
.kbottom-tabs {
  display: none;
  position: fixed; left:0; right:0; bottom:0; z-index: 999;
  background: rgba(12,10,20,.85);
  backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  justify-content: space-around;
  align-items: center;
}
@media (max-width: 980px) { .kbottom-tabs { display: flex; } }
.kbottom-tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 8px; border-radius: 12px;
  color: var(--muted); font-size: 10.5px; font-weight: 700;
  flex: 1; min-width: 0;
}
.kbottom-tab i { font-size: 17px; }
.kbottom-tab.active { color: #fff; }
.kbottom-tab.active i {
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 8px rgba(139,92,246,.5));
}

/* ── Hub cards (usado em /pessoal.php, /apps/, etc.) ─────────────── */
.khub-wrap { max-width: 1080px; margin: 0 auto; padding: 26px 26px 60px; }
@media (max-width: 700px) { .khub-wrap { padding: 20px 16px 90px; } }
.khub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px,1fr)); gap: 16px; margin-top: 22px; }
.khub-card {
  background: var(--surface); backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--border); border-radius: 18px; padding: 22px;
  display: flex; flex-direction: column; gap: 10px; text-decoration:none; color:var(--text);
  transition: transform .18s, border-color .18s; box-shadow: var(--glow);
}
.khub-card:hover { transform: translateY(-3px); border-color: rgba(139,92,246,.4); }
.khub-icon { width: 46px; height: 46px; border-radius: 13px; display:flex; align-items:center; justify-content:center; font-size:19px; }
.khub-name { font-size: 15.5px; font-weight: 800; }
.khub-desc { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.khub-meta { margin-top:auto; font-size:11.5px; color:var(--muted); font-weight:700; display:flex; align-items:center; gap:6px; }

/* ── Progress bar (usado em /metas) ──────────────────────────────── */
.kprogress { height: 8px; border-radius: 999px; background: rgba(255,255,255,.07); overflow:hidden; }
.kprogress-bar { height: 100%; border-radius: 999px; background: var(--gradient); transition: width .4s ease; }

/* ── Barra superior mobile (só quando a sidebar está escondida) ──── */
.ktopbar-mobile {
  display: none;
  position: sticky; top: 0; z-index: 900;
  align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: rgba(7,7,13,.7);
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border2);
}
.ktopbar-mobile img { height: 30px; }
@media (max-width: 980px) { .ktopbar-mobile { display: flex; } }

.kside-overlay {
  display: none; position: fixed; inset: 0; z-index: 998;
  background: rgba(4,3,8,.7); backdrop-filter: blur(4px);
}
.kside-overlay.show { display: block; }

/* ── Date nav (slider de dias) — variante E ────────────────────────
   Estrutura HTML existente (sem alterações ao markup):
   <div class="k-date-nav">
     <a class="k-date-nav-btn"><i class="fa-solid fa-chevron-left"></i></a>
     <label class="k-date-nav-label">
       <i class="fa-solid fa-calendar-days"></i>Sáb, 22 Ago
       <input type="date" ...>
     </label>
     <a class="k-date-nav-btn"><i class="fa-solid fa-chevron-right"></i></a>
   </div>
   ─────────────────────────────────────────────────────────────────── */
.k-date-nav {
  display: inline-flex; align-items: center; gap: 3px; flex: 0 0 auto;
  background: var(--gradient-soft);
  border: 1px solid rgba(34,211,238,.4);
  border-radius: 12px; padding: 3px;
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
}
.k-date-nav-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 36px; flex: 0 0 30px; border-radius: 9px;
  color: var(--muted); background: none; text-decoration: none;
  border: none; font-size: 13px; cursor: pointer;
  font-family: inherit;
  transition: background .15s ease, color .15s ease;
}
.k-date-nav-btn:hover { background: rgba(255,255,255,.06); color: var(--text); }
.k-date-nav-btn:active { transform: scale(.94); }
.k-date-nav-label {
  position: relative; display: flex; align-items: center; gap: 7px;
  padding: 0 14px; height: 36px;
  border-radius: 9px; margin: 0 1px; cursor: pointer;
  font-size: 13.5px; font-weight: 800; letter-spacing: -.01px; white-space: nowrap;
  color: var(--text);
  transition: background .15s ease;
}
.k-date-nav-label:hover { background: rgba(139,92,246,.1); }
.k-date-nav-label i { font-size: 12px; color: var(--text); flex-shrink: 0; }
.k-date-nav-label input[type="date"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; border: none; padding: 0; margin: 0;
  -webkit-appearance: none; appearance: none;
}

/* ── Tabs / toggle segmentado — usado sempre que há 2+ botões lado a
   lado que representam vistas/secções irmãs (ex: "Acumulado / Fixas").
   Funciona com <a> (navegação entre páginas) ou <button> (toggle JS
   dentro da mesma página) — nesse caso adicionar/remover .active via JS.
   <div class="k-tabs">
     <a class="k-tabs-item active" href="...">Acumulado</a>
     <a class="k-tabs-item" href="...">Fixas</a>
   </div> */
.k-tabs {
  display: inline-flex; align-items: center; gap: 2px; width: fit-content;
  background: var(--gradient-soft); border: 1px solid rgba(34,211,238,.4);
  border-radius: 10px; padding: 3px;
}
.k-tabs-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: none;
  background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 700; font-family: inherit;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.k-tabs-item:hover { color: #fff; background: rgba(255,255,255,.08); }
.k-tabs-item.active,
.k-tabs-item.is-active {
  color: #fff; background: var(--gradient);
}

/* ── Dropdown personalizado (select "falso") — usado sempre que é
   preciso um <select> com visual da marca (ex: filtro "Todas as ligas").
   Requer um pouco de JS para abrir/fechar a lista e marcar a opção
   activa (ver apps/predict_dashboard/index.php para um exemplo):
   <div class="k-select">
     <button type="button" class="k-select-trigger">
       <i class="fa-solid fa-trophy"></i>
       <span class="k-select-label">Todas as ligas</span>
       <i class="fa-solid fa-chevron-down k-select-caret"></i>
     </button>
     <div class="k-select-list">
       <div class="k-select-opt is-active" data-value="">Todas as ligas</div>
       <div class="k-select-opt" data-value="x">Opção X</div>
     </div>
   </div> */
.k-select { position: relative; display: inline-flex; align-items: center; flex: 0 0 auto; }
.k-select-trigger {
  all: unset;
  box-sizing: border-box;
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; font: inherit;
  border: 1px solid rgba(34,211,238,.4);
  background: var(--gradient-soft);
  padding: 9px 14px;
  border-radius: 10px;
  color: var(--text); font-size: 13px; font-weight: 700;
  transition: box-shadow .15s ease;
  white-space: nowrap;
}
.k-select-trigger:hover { box-shadow: 0 0 0 3px rgba(34,211,238,.18); }
.k-select-trigger.open,
.k-select-trigger.is-open {
  background: var(--gradient); color: #fff; border-color: transparent;
}
.k-select-label { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-select-caret { font-size: 10px; opacity: .75; transition: transform .15s ease; }
.k-select-trigger.open .k-select-caret,
.k-select-trigger.is-open .k-select-caret { transform: rotate(180deg); }
.k-select-list {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 100%; max-height: 280px;
  overflow-y: auto; background: #181828; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.5); z-index: 100;
}
.k-select-list.show { display: block; animation: kSelectIn .12s ease; }
@keyframes kSelectIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }
.k-select-opt {
  display: block;
  padding: 9px 16px; font-size: 13px; font-weight: 600; color: #f4f4f8;
  cursor: pointer; transition: background .1s ease;
}
.k-select-opt:first-child { border-radius: 12px 12px 0 0; }
.k-select-opt:last-child  { border-radius: 0 0 12px 12px; }
.k-select-opt:hover { background: rgba(139,92,246,.2); }
.k-select-opt.active,
.k-select-opt.is-active { background: var(--gradient); color: #fff; }

/* ── Botão Retroceder (voltar à página anterior) ──────────────────
   Mesma forma/tamanho do .btn.btn-icon (quadrado, cantos arredondados
   var(--radius-sm)), mas com fundo em gradiente da marca. Usar em
   <a> ou <button>: <a href="..." class="btn-back"><i class="fa-solid fa-arrow-left"></i></a>
   Para versão com texto ("Voltar"), acrescentar a classe .btn-back-label. */
.btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--gradient);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(139,92,246,.35);
  transition: filter .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn-back i,
.btn-back svg { pointer-events: none; }
.btn-back:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(139,92,246,.5);
}
.btn-back:active { transform: translateY(0) scale(.96); }

/* variante com rótulo de texto ("Voltar") */
.btn-back.btn-back-label {
  padding: 10px 16px 10px 13px;
  font-size: 13.5px;
  font-weight: 700;
}
/* ════════════════════════════════════════════════════════════════
   DROPDOWN PILL — .select-pill
   Select nativo com visual pill arredondado, borda ciana subtil,
   fundo var(--surface), seta SVG embutida.
   Usar em filtros e barras de ferramentas.
   Exemplo: <select class="select-pill">...</select>
   ════════════════════════════════════════════════════════════════ */
.select-pill {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: inline-block;
  padding: 7px 30px 7px 14px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  color: var(--text);
  border-radius: 999px;
  border: 1px solid rgba(34,211,238,.35);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2322d3ee' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: box-shadow .15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.select-pill:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(34,211,238,.18);
}
/* Nota: .select-pill é para <select> nativos (lista gerida pelo browser).
   Para droplists totalmente customizadas, usar .k-select + .k-select-trigger. */


/* ── Utilitários de estado — cross-page ────────────────────────────────
   Estas classes aparecem em múltiplos módulos com definições idênticas.
   Centralizar aqui evita repetição nos <style> inline de cada página.    */

/* Cores de estado (texto) */
.ok,
.pos,
.good  { color: var(--ok); }
.bad,
.neg   { color: var(--bad); }
.muted { color: var(--muted); }

/* Visibilidade */
.is-visible { display: block; }
.is-hidden  { display: none !important; }

/* Estado "copiado" — botões de copy-to-clipboard */
.copied {
  background: rgba(52,224,161,.15);
  color: var(--ok);
  border-color: rgba(52,224,161,.35);
}

/* Loading genérico */
.loading {
  text-align: center;
  padding: 30px;
  color: var(--muted);
  font-size: 14px;
}

/* Estado "feito/concluído" */
.done {
  border-color: var(--border);
  color: var(--muted);
  background: var(--surface);
}

/* Estado de erro (texto/border) */
.erro {
  color: var(--bad);
  border-color: rgba(251,113,133,.4);
}

/* ── Utilitários de layout ─────────────────────────────────────────── */

/* Page header com título e botão de ação alinhados */
.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
@media (max-width: 600px) {
  .page-header-row {
    grid-template-columns: minmax(0,1fr) auto;
    grid-template-areas: "title add" "nav nav";
    row-gap: 10px;
  }
}
