/* ── Sync Status & Header Actions ── */
.sync-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--amber);
  margin-top: 0.3rem;
}
.header-actions {
  display: flex;
  gap: 0.5rem;
}
.bank-sync-btn, .export-btn, .import-btn {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  background: var(--panel2);
  border: 1px solid var(--teal-dim);
  color: var(--teal);
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.bank-sync-btn:hover, .export-btn:hover, .import-btn:hover {
  background: var(--teal-dim);
  color: var(--void);
}

/* ── Crystals Card ── */
.crystals-card {
  border-color: var(--amber);
}
.crystals-card .sc-icon {
  background: var(--amber-dim);
  color: var(--amber);
}
.crystals-card .sc-amount {
  color: var(--amber);
}

/* ── Gamification ── */
.gamify-badge {
  background: var(--teal-dim);
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  border-radius: 4px;
  padding: 0.1em 0.5em;
  margin-left: 0.5em;
  vertical-align: middle;
}

/* ── Oracle Tip ── */
.oracle-tip {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--gold);
  margin-left: 1.2em;
}
/* ============================================================
   ARCANE LEDGER — Expense Tracker CSS
   Fully responsive · Dark fantasy · Teal arcane palette
============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

:root {
  --void:        #04080d;
  --panel:       #080f18;
  --panel2:      #0c1520;
  --teal:        #00ffc8;
  --teal-dim:    rgba(0,255,200,0.1);
  --teal-glow:   rgba(0,255,200,0.28);
  --gold:        #c8852a;
  --red:         #ff4d4d;
  --red-dim:     rgba(255,77,77,0.12);
  --green:       #3ddc84;
  --green-dim:   rgba(61,220,132,0.12);
  --amber:       #ffaa00;
  --amber-dim:   rgba(255,170,0,0.12);
  --text:        #c8d8e8;
  --muted:       #4a6070;
  --border:      rgba(0,255,200,0.12);
  --radius:      10px;
  --font-title:  'Cinzel', serif;
  --font-body:   'Crimson Pro', serif;
  --font-mono:   'Share Tech Mono', monospace;
}

body {
  background: var(--void);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Cursor ── */
.cursor-dot {
  position: fixed; width: 8px; height: 8px; border-radius: 50%;
  background: var(--teal); box-shadow: 0 0 10px var(--teal);
  pointer-events: none; z-index: 99999;
  transform: translate(-50%,-50%); mix-blend-mode: screen;
  transition: transform .15s;
}
.cursor-ring {
  position: fixed; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid rgba(0,255,200,0.35);
  pointer-events: none; z-index: 99998;
  transform: translate(-50%,-50%);
}

/* ── Background ── */
.bg-wrap { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-orb {
  position: absolute; border-radius: 50%;
  filter: blur(120px); opacity: 0.18;
  animation: orb-drift 18s ease-in-out infinite alternate;
}
.orb-1 { width: 600px; height: 600px; background: #00ffc8; top: -150px; left: -150px; }
.orb-2 { width: 500px; height: 500px; background: #0055ff; bottom: -120px; right: -120px; animation-duration: 24s; }
@keyframes orb-drift { from{transform:translate(0,0);} to{transform:translate(35px,-30px);} }
.bg-grid {
  position: absolute; inset: 0; opacity: 1;
  background-image:
    linear-gradient(rgba(0,255,200,0.022) 1px,transparent 1px),
    linear-gradient(90deg,rgba(0,255,200,0.022) 1px,transparent 1px);
  background-size: 36px 36px;
}

/* ── App ── */
.app {
  position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
  display: flex; flex-direction: column; gap: 1.5rem;
}

/* ── Header ── */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
}
.back-link {
  font-family: var(--font-mono); font-size: 0.7rem;
  letter-spacing: 0.12em; color: var(--muted);
  text-decoration: none; transition: color .2s;
}
.back-link:hover { color: var(--teal); }
.header-center { text-align: center; }
.app-title {
  font-family: var(--font-title); font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700; color: var(--teal);
  text-shadow: 0 0 20px var(--teal-glow);
  letter-spacing: 0.08em;
}
.app-subtitle {
  font-family: var(--font-body); font-style: italic;
  font-size: 0.9rem; color: var(--muted); margin-top: 0.2rem;
}
.clear-all-btn {
  font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.12em;
  text-transform: uppercase; background: rgba(255,77,77,0.1);
  border: 1px solid rgba(255,77,77,0.3); color: #e06060;
  padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; transition: all .2s;
}
.clear-all-btn:hover { background: rgba(255,77,77,0.2); }

/* ── Summary Row ── */
.summary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.summary-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  display: flex; align-items: center; gap: 1rem;
  transition: border-color .2s;
}
.income-card  { border-color: rgba(61,220,132,0.2); }
.expense-card { border-color: rgba(255,77,77,0.2); }
.balance-card { border-color: rgba(0,255,200,0.2); }
.income-card:hover  { border-color: rgba(61,220,132,0.5); }
.expense-card:hover { border-color: rgba(255,77,77,0.5); }
.balance-card:hover { border-color: rgba(0,255,200,0.4); }

.sc-icon {
  font-family: var(--font-title); font-size: 1.5rem;
  width: 42px; height: 42px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.income-card  .sc-icon { background: var(--green-dim); color: var(--green); }
.expense-card .sc-icon { background: var(--red-dim);   color: var(--red); }
.balance-card .sc-icon { background: var(--teal-dim);  color: var(--teal); }

.sc-label {
  font-family: var(--font-mono); font-size: 0.6rem;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 0.3rem;
}
.sc-amount {
  font-family: var(--font-mono); font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 700;
}
.income-card  .sc-amount { color: var(--green); }
.expense-card .sc-amount { color: var(--red); }
.balance-card .sc-amount { color: var(--teal); }
.balance-card .sc-amount.negative { color: var(--red); }

/* ── Spend Bar ── */
.spend-bar-wrap {
  display: flex; flex-direction: column; gap: 0.4rem;
}
.spend-bar-label {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 0.62rem;
  letter-spacing: 0.1em; color: var(--muted);
}
.spend-bar-track {
  width: 100%; height: 5px;
  background: rgba(255,255,255,0.07); border-radius: 3px; overflow: hidden;
}
.spend-bar-fill {
  height: 100%; width: 0%; border-radius: 3px;
  background: linear-gradient(90deg, var(--green), var(--teal));
  transition: width .6s ease, background .3s;
  box-shadow: 0 0 8px var(--teal);
}
.spend-bar-fill.warn  { background: linear-gradient(90deg, var(--amber), #ff8800); box-shadow: 0 0 8px var(--amber); }
.spend-bar-fill.danger{ background: linear-gradient(90deg, var(--red), #ff2200);   box-shadow: 0 0 8px var(--red); }

/* ── Main Grid ── */
.main-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* ── Section Label ── */
.section-label {
  font-family: var(--font-mono); font-size: 0.68rem;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--teal); opacity: 0.7; margin-bottom: 0.9rem;
}

/* ── Form ── */
.form-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  display: flex; flex-direction: column; gap: 1.1rem;
}

/* Type tabs */
.type-tabs {
  display: flex; gap: 0.4rem;
}
.type-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.08em;
  text-transform: uppercase; background: transparent;
  border: 1px solid rgba(255,255,255,0.08); color: var(--muted);
  padding: 0.5rem; border-radius: 6px; cursor: pointer; transition: all .2s;
}
.type-tab:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }
.type-tab.active[data-type="income"]   { background: var(--green-dim); border-color: rgba(61,220,132,0.4); color: var(--green); }
.type-tab.active[data-type="borrowed"] { background: var(--amber-dim); border-color: rgba(255,170,0,0.4);  color: var(--amber); }
.type-tab.active[data-type="expense"]  { background: var(--red-dim);   border-color: rgba(255,77,77,0.4);  color: var(--red); }

.tab-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.income-dot  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.borrowed-dot{ background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.expense-dot { background: var(--red);   box-shadow: 0 0 6px var(--red); }

/* Fields */
.form-fields { display: flex; flex-direction: column; gap: 0.85rem; }
.field-wrap  { display: flex; flex-direction: column; gap: 0.35rem; }
.field-label {
  font-family: var(--font-mono); font-size: 0.6rem;
  letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted);
}
.form-input {
  background: rgba(0,255,200,0.03); border: 1px solid var(--border);
  border-radius: 7px; padding: 0.7rem 0.9rem; color: var(--text);
  font-family: var(--font-body); font-size: 1rem; outline: none;
  transition: all .2s; width: 100%; color-scheme: dark;
}
.form-input::placeholder { color: var(--muted); }
.form-input:focus {
  border-color: rgba(0,255,200,0.4);
  box-shadow: 0 0 0 3px rgba(0,255,200,0.07);
}
.amount-wrap { position: relative; }
.currency-sign {
  position: absolute; left: 0.9rem; top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono); color: var(--muted); font-size: 0.9rem;
  pointer-events: none;
}
.amount-input { padding-left: 1.8rem; }

.add-btn {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; background: rgba(0,255,200,0.12);
  border: 1px solid rgba(0,255,200,0.4); color: var(--teal);
  padding: 0.85rem; border-radius: 7px; cursor: pointer;
  transition: all .2s; width: 100%;
}
.add-btn:hover { background: rgba(0,255,200,0.22); box-shadow: 0 0 18px var(--teal-glow); }
.add-btn.income-mode   { border-color: rgba(61,220,132,0.4); color: var(--green); background: var(--green-dim); }
.add-btn.borrowed-mode { border-color: rgba(255,170,0,0.4);  color: var(--amber); background: var(--amber-dim); }
.add-btn.expense-mode  { border-color: rgba(255,77,77,0.4);  color: var(--red);   background: var(--red-dim); }

/* ── Transaction List ── */
.list-section { display: flex; flex-direction: column; gap: 0.75rem; }
.list-header {
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 0.75rem;
}
.list-controls { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.mini-select {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.06em;
  background: var(--panel); border: 1px solid var(--border); color: var(--muted);
  padding: 0.35rem 0.6rem; border-radius: 5px; cursor: pointer; outline: none;
  transition: all .2s;
}
.mini-select:focus { border-color: rgba(0,255,200,0.35); color: var(--text); }

.transaction-count {
  font-family: var(--font-mono); font-size: 0.6rem;
  letter-spacing: 0.1em; color: var(--muted);
}

.transaction-list { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }

/* Empty state */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.75rem; padding: 3rem 1rem; text-align: center;
}
.empty-icon { font-size: 2.5rem; opacity: 0.2; }
.empty-state p {
  font-family: var(--font-body); font-style: italic;
  color: var(--muted); font-size: 1rem; line-height: 1.6;
}

/* Transaction item */
.tx-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  display: flex; align-items: center; gap: 0.85rem;
  transition: all .2s; position: relative; overflow: hidden;
}
.tx-item::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
}
.tx-item.income   { border-color: rgba(61,220,132,0.15); }
.tx-item.borrowed { border-color: rgba(255,170,0,0.15); }
.tx-item.expense  { border-color: rgba(255,77,77,0.15); }
.tx-item.income::before   { background: var(--green); }
.tx-item.borrowed::before { background: var(--amber); }
.tx-item.expense::before  { background: var(--red); }
.tx-item:hover { transform: translateX(4px); box-shadow: 0 4px 20px rgba(0,0,0,0.3); }

.tx-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.income   .tx-dot { background: var(--green); box-shadow: 0 0 6px var(--green); }
.borrowed .tx-dot { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.expense  .tx-dot { background: var(--red);   box-shadow: 0 0 6px var(--red); }

.tx-body { flex: 1; min-width: 0; }
.tx-desc {
  font-family: var(--font-body); font-size: 0.98rem;
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tx-meta {
  font-family: var(--font-mono); font-size: 0.58rem;
  letter-spacing: 0.08em; color: var(--muted); margin-top: 0.2rem;
  display: flex; gap: 0.6rem; flex-wrap: wrap;
}
.tx-cat-badge {
  font-family: var(--font-mono); font-size: 0.55rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  padding: 0.08rem 0.4rem; border-radius: 3px; color: var(--muted);
}

.tx-amount {
  font-family: var(--font-mono); font-size: 0.95rem;
  font-weight: 700; flex-shrink: 0; min-width: 80px; text-align: right;
}
.income   .tx-amount { color: var(--green); }
.borrowed .tx-amount { color: var(--amber); }
.expense  .tx-amount { color: var(--red); }

.tx-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }
.tx-btn {
  width: 28px; height: 28px; border-radius: 5px; border: 1px solid;
  cursor: pointer; font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s; background: transparent;
}
.edit-btn  { border-color: rgba(0,255,200,0.25); color: var(--teal); }
.edit-btn:hover  { background: var(--teal-dim); box-shadow: 0 0 8px var(--teal-glow); }
.del-btn   { border-color: rgba(255,77,77,0.25); color: var(--red); }
.del-btn:hover   { background: var(--red-dim); }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--panel); border: 1px solid rgba(0,255,200,0.25);
  border-radius: 14px; width: 100%; max-width: 420px; padding: 1.75rem;
  position: relative; box-shadow: 0 0 50px rgba(0,255,200,0.1);
  animation: modal-in .2s ease-out;
}
@keyframes modal-in { from{opacity:0;transform:scale(.96) translateY(8px);} to{opacity:1;transform:scale(1) translateY(0);} }
.modal::before {
  content:''; position:absolute; top:0; left:0; right:0; height:3px; border-radius:14px 14px 0 0;
  background: linear-gradient(90deg,transparent,var(--teal),transparent);
}
.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: var(--muted); width: 28px; height: 28px; border-radius: 50%;
  cursor: pointer; font-size: 0.8rem; transition: all .2s;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--teal-dim); color: var(--teal); }
.modal-title {
  font-family: var(--font-title); font-size: 1.1rem;
  color: #e8f0ff; margin-bottom: 0.25rem;
}
.modal-actions { margin-top: 1.25rem; }

/* ── Responsive ── */
@media (max-width: 820px) {
  .main-grid { grid-template-columns: 1fr; }
  .summary-row { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 540px) {
  .summary-row { grid-template-columns: 1fr; gap: 0.6rem; }
  .app { padding: 1rem 1rem 3rem; gap: 1.2rem; }
  .list-controls { gap: 0.3rem; }
  .app-header { flex-direction: column; align-items: flex-start; }
  .header-center { align-self: center; }
}
@media (max-width: 360px) {
  .type-tabs { flex-direction: column; }
}

/* ============================================================
   LOCAL STORAGE DISCLAIMER BANNER
============================================================ */

.local-disclaimer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 215, 0, 0.04);
  border: 1px solid rgba(255, 215, 0, 0.18);
  border-left: 3px solid rgba(255, 215, 0, 0.5);
  border-radius: 6px;
  padding: 0.65rem 1.1rem;
  margin: 0.75rem 1.5rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: rgba(255, 215, 0, 0.65);
  line-height: 1.5;
}

/* Vault: fits inside the main-wrap, full width minus sidebar */
.main-wrap .local-disclaimer {
  margin: 0.75rem 1.5rem 0;
}

/* Codex: sits between the split screen and footer */
.codex-disclaimer {
  max-width: 900px;
  margin: 0.5rem auto;
  justify-content: center;
  text-align: center;
  border-left: 1px solid rgba(255, 215, 0, 0.18);
  border-bottom: 1px solid rgba(255, 215, 0, 0.18);
  border-radius: 0 0 6px 6px;
  border-top: none;
}

.disclaimer-icon {
  font-size: 0.85rem;
  flex-shrink: 0;
  opacity: 0.8;
}

.disclaimer-text {
  flex: 1;
}

@media (max-width: 600px) {
  .local-disclaimer {
    margin: 0.5rem 0.75rem;
    font-size: 0.65rem;
  }
}
