/* ===== TEMA HACKER VERDE – gruposigilo ===== */
:root{
  --bg:#050a07;
  --panel:#07130d;
  --text:#d8ffe9;
  --muted:#86e3b1;
  --primary:#18ff8b;        /* verde neon */
  --primary-press:#13d173;
  --stroke:#0e2a1e;
  --stroke-soft:#0a1d15;
  --error:#ef4444;
  --ring: 0 0 0 3px rgba(24,255,139,.35);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font:15.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  color:var(--text);
  background:
    radial-gradient(1200px 600px at 50% -10%, #0a2b1c 0%, transparent 60%),
    radial-gradient(900px 400px at 100% 0%, #092418 0%, transparent 60%),
    linear-gradient(180deg,#030906 0%, #010503 100%);
  letter-spacing:.2px;
}

/* overlay de “scanlines” + grade */
body::before{
  content:"";
  position:fixed; inset:0;
  background:
    repeating-linear-gradient(0deg, rgba(24,255,139,.05) 0 2px, transparent 2px 4px),
    linear-gradient(rgba(24,255,139,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24,255,139,.06) 1px, transparent 1px);
  background-size: auto, 36px 36px, 36px 36px;
  pointer-events:none;
  mix-blend-mode: screen;
  opacity:.35;
  z-index:0;
}

/* feixe de varredura vertical (“scanner”) */
body::after{
  content:"";
  position:fixed; left:0; right:0; top:-15%;
  height:140%;
  background:linear-gradient(180deg, transparent 0%, rgba(24,255,139,.08) 45%, transparent 60%);
  animation:scan 5s linear infinite;
  pointer-events:none; z-index:0;
}
@keyframes scan{ from{ transform:translateY(-25%) } to{ transform:translateY(25%) } }

/* ===== Estrutura de página ===== */
.page{
  max-width:980px;
  margin:64px auto;
  padding:24px;
  opacity:1;
  transition:opacity .2s ease, filter .2s ease;
}
body.locked{overflow:hidden}
body.locked .page{display:none !important}

/* ===== Navbar (abas) ===== */
.topnav{
  display:flex; gap:10px; align-items:center; justify-content:flex-end;
  margin:-8px 0 18px;
}
.k-tab{
  display:inline-block;
  padding:10px 14px;
  border-radius:12px;
  text-decoration:none;
  color:#b7ffe0;
  border:1px solid var(--stroke);
  background:linear-gradient(180deg, rgba(24,255,139,.06), rgba(24,255,139,.02));
  transition:filter .15s ease, border-color .15s ease, color .15s ease;
}
.k-tab:hover{ filter:saturate(115%); border-color:#1d6a47; color:#eafff4; }
.k-tab.active{
  color:#072414;
  background:linear-gradient(180deg, var(--primary) 0%, #0eea7c 100%);
  border-color:transparent;
}

/* ===== Botões ===== */
.k-btn{
  appearance:none; border:0; border-radius:12px;
  padding:10px 14px; font-weight:700; cursor:pointer;
  transition:transform .02s ease, box-shadow .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
  letter-spacing:.3px;
}
.k-btn:active{ transform:translateY(1px) }

.k-btn.k-primary{
  background:linear-gradient(180deg, var(--primary) 0%, #0eea7c 100%);
  color:#052213;
  text-shadow:0 1px 0 rgba(255,255,255,.15);
  box-shadow:0 10px 28px rgba(24,255,139,.35), 0 0 0 1px rgba(24,255,139,.35) inset;
}
.k-btn.k-primary:hover{ filter:saturate(115%) }
.k-btn.k-primary:focus-visible{ outline:none; box-shadow:var(--ring), 0 0 0 1px rgba(24,255,139,.2) inset; }

.k-btn.k-secondary{
  background:linear-gradient(180deg, rgba(24,255,139,.1), rgba(24,255,139,.05));
  color:#b7ffe0;
  border:1px solid var(--stroke);
}
.k-btn.k-secondary:hover{ border-color:#1d6a47; color:#e4fff3 }

.k-btn.k-ghost{
  background:transparent;
  color:#9af9c9;
  border:1px solid var(--stroke);
}
.k-btn.k-ghost:hover{ border-color:#1d6a47; color:#c5ffdf }

/* ===== Toolbars ===== */
.sheet-toolbar{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  margin:6px 0 12px;
}

/* ===== Tabelas (base) ===== */
.table-wrap{ margin:10px 0 0 }
.k-table{
  width:100%;
  border-collapse:collapse;
  border-spacing:0;
  background:transparent;
}
.k-table th, .k-table td{
  padding:10px 12px;
  border-bottom:1px solid rgba(24,255,139,.10);
}
.k-table thead th{
  text-align:left;
  font-weight:800;
  color:#84f7b8;
  background:linear-gradient(180deg, rgba(24,255,139,.08), rgba(24,255,139,.03));
  border-bottom:1px solid rgba(24,255,139,.16);
}
.k-table tbody tr:nth-child(even) td{ background:rgba(24,255,139,.02) }
.k-table tbody tr:hover td{ background:rgba(24,255,139,.05) }
.k-table .num{ text-align:right; font-variant-numeric: tabular-nums; }
.section-title{ margin:8px 0 6px; font-weight:800; color:#87ffc7 }

/* ===== Modais ===== */
.k-modal::backdrop{
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(1px);
}
.k-modal{
  border:1px solid var(--stroke);
  border-radius:14px;
  padding:16px 16px 10px;
  color:var(--text);
  background: linear-gradient(180deg, rgba(3,16,11,.94), rgba(5,20,14,.92));
  box-shadow: 0 25px 60px rgba(0,0,0,.65), 0 0 30px rgba(24,255,139,.08);
  width:min(92vw, 520px);
}
.k-modal h3{ margin:0 0 10px }
.k-modal .grid{
  display:grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap:10px;
}
.k-modal .grid > *:nth-child(1){ grid-column: span 4; }
.k-modal .grid > *:nth-child(2){ grid-column: span 1; }
.k-modal .grid > *:nth-child(3){ grid-column: span 1; }
.k-modal .grid > *:nth-child(4){ grid-column: span 1; }
.k-modal .grid > *:nth-child(5){ grid-column: span 1; }

.k-modal input, .k-modal select{
  width:100%; padding:10px 12px; border-radius:10px;
  background:#07120e; border:1px solid var(--stroke); color:var(--text);
  box-shadow: inset 0 0 0 1px rgba(24,255,139,.08);
}
.k-modal input::placeholder{ color:#3aa86f }
.k-modal input:focus, .k-modal select:focus{
  outline:none; border-color:var(--primary); box-shadow:var(--ring), 0 0 0 1px rgba(24,255,139,.15) inset; background:#051c13;
}
.k-modal menu{ display:flex; justify-content:flex-end; gap:8px; margin-top:12px; padding:0 }

/* ===== Formulário padrão ===== */
label{
  display:block;
  font-size:12px;
  color:#84f7b8;
  margin:10px 0 6px;
  letter-spacing:.3px;
}
input, select{
  width:100%;
  padding:11px 12px;
  background:#07120e;
  border:1px solid var(--stroke);
  border-radius:10px;
  color:var(--text);
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: inset 0 0 0 1px rgba(24,255,139,.08);
}
input::placeholder{color:#3aa86f}
input:focus, select:focus{
  border-color:var(--primary);
  box-shadow:var(--ring), 0 0 0 1px rgba(24,255,139,.15) inset;
  background:#051c13;
}
.error{
  margin-top:12px;
  background:rgba(239,68,68,.08);
  border:1px solid rgba(239,68,68,.35);
  color:#ffd4d4;
  padding:8px 10px;
  border-radius:10px;
  font-size:13px;
}

/* ===== Login (index) ===== */
.overlay{
  position:fixed; inset:0;
  display:grid; place-items:center;
  background:transparent;
  backdrop-filter:none;
  z-index:2;
}
.card{
  position:relative;
  width:min(92vw, 460px);
  background: linear-gradient(180deg, rgba(3,16,11,.92), rgba(5,20,14,.92));
  border:1px solid var(--stroke);
  border-radius:16px;
  padding:22px 22px 18px;
  box-shadow:
    0 25px 60px rgba(0,0,0,.65),
    0 0 30px rgba(24,255,139,.08);
  animation:pop .12s ease-out;
}
@keyframes pop { from{ transform:scale(.98); opacity:.6 } to{ transform:scale(1); opacity:1 } }

.card h1{
  text-align:center;
  margin:0 0 22px !important;
  font-size:21px;
  font-weight:800;
  color:var(--text);
  text-shadow: 0 0 12px rgba(24,255,139,.35);
}
.cursor{
  display:inline-block;
  width:1ch;
  margin-left:2px;
  opacity:.9;
  animation:blink 1s steps(1,end) infinite;
  filter: drop-shadow(0 0 6px rgba(24,255,139,.5));
}
@keyframes blink { 50% { opacity:0; } }

/* ===== Acessibilidade ===== */
@media (prefers-reduced-motion: reduce){
  body::before, body::after{ display:none !important; }
}

/* ===== Utilidades ===== */
.sr-only{
  position:absolute !important;
  width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;
}

/* =================================================================== */
/* =========================  GASTOS  ================================= */
/* =================================================================== */

/* Página wide apenas para GASTOS */
.page.wide{
  max-width: 1400px;
  padding-left: 24px;
  padding-right: 24px;
}

/* Tabela centralizada, sem scroll lateral, colunas fixas */
.page.wide .k-table.gastos{
  width: 100% !important;
  max-width: 1280px;
  margin: 16px auto !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
}

/* células com bom respiro */
.page.wide .k-table.gastos th,
.page.wide .k-table.gastos td{
  padding: 10px 10px !important;
  font-size: 16px !important;
  line-height: 1.55 !important;
  white-space: nowrap;
  border-bottom: 1px solid rgba(24,255,139,.08);
}

/* cabeçalho */
.page.wide .k-table.gastos thead th{
  text-align:center;
  letter-spacing:.6px;
  background:linear-gradient(180deg, rgba(24,255,139,.08), rgba(24,255,139,.03));
  border-bottom:1px solid rgba(24,255,139,.16);
}

/* primeira coluna (cartões) compacta + reticências no corpo */
.page.wide .k-table.gastos th:first-child{
  width: 120px !important;
  text-align:left;
}
.page.wide .k-table.gastos tbody th{
  width: 120px !important;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* meses abreviados com largura fixa */
.page.wide .k-table.gastos thead th.th-month{ width: 88px !important; }
.page.wide .k-table.gastos thead .th-total{
  background: linear-gradient(180deg, #d7a514, #b8860b) !important;
  color:#111; text-shadow:none; font-weight:900;
  width: 96px !important;
}

/* números */
.page.wide .k-table.gastos td.num{
  text-align:right;
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  letter-spacing: 0;
}

/* total e “pago” */
.page.wide .k-table.gastos td.total{
  background: rgba(184,134,11,.12);
  font-weight:800;
}
.page.wide .k-table.gastos .paid{
  color:#18ff8b; font-weight:900; text-align:center;
}

/* separadores verticais discretos */
.page.wide .k-table.gastos th + th,
.page.wide .k-table.gastos td + td{
  border-left: 1px solid rgba(255,255,255,.06);
}

/* rodapé FATURA */
.page.wide .k-table.gastos tfoot th,
.page.wide .k-table.gastos tfoot td{
  background:transparent;
  border-top:2px solid rgba(24,255,139,.16);
  padding-top:16px !important;
}

/* toolbar alinhada à largura da grade */
.page.wide .sheet-toolbar{
  max-width:1280px;
  margin:22px auto 12px;
  gap:12px;
}

/* Espaço entre o campo "Senha" e os botões do login */
.card .actions{
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* (opcional) dá um respiro extra abaixo dos inputs do card */
.card label + input{
  margin-bottom: 6px;
}

/* Compatível com as duas nomenclaturas de botão que você usou */
.card .actions .k-btn,
.card .actions .primary,
.card .actions .ghost{
  padding: 10px 14px;
  min-height: 40px;
}

/* Login: inputs maiores e alinhados à esquerda */
.card input{
  text-align: left !important;
  font-size: 18px;
  height: 48px;
  line-height: 48px;
  padding: 0 14px;
}
.card input::placeholder{
  text-align: left !important;
  font-size: 18px;
  line-height: 48px;
}