/* =============================================
   EXPENSE TRACKER — SHARED DESIGN SYSTEM
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg:          #0d0f14;
  --bg2:         #13161e;
  --bg3:         #1a1e2a;
  --card:        #181c27;
  --border:      rgba(255,255,255,0.07);
  --border-glow: rgba(99,179,237,0.25);

  --green:       #22d3a0;
  --green-dim:   rgba(34,211,160,0.12);
  --green-glow:  rgba(34,211,160,0.35);
  --red:         #f87171;
  --red-dim:     rgba(248,113,113,0.12);
  --amber:       #fbbf24;
  --blue:        #63b3ed;
  --blue-dim:    rgba(99,179,237,0.12);

  --text:        #e2e8f0;
  --text-muted:  #64748b;
  --text-sub:    #94a3b8;

  --radius:      14px;
  --radius-sm:   8px;
  --shadow:      0 20px 60px rgba(0,0,0,0.5);
  --shadow-sm:   0 4px 20px rgba(0,0,0,0.3);

  --font:        'Sora', sans-serif;
  --mono:        'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── NOISE TEXTURE OVERLAY ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.4;
}

/* ── GRADIENT ORBS ── */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}
.orb-1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(34,211,160,0.08) 0%, transparent 70%);
  top: -100px; left: -100px;
}
.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(99,179,237,0.06) 0%, transparent 70%);
  bottom: -150px; right: -150px;
}

/* ── CARD ── */
.card {
  position: relative;
  z-index: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ── INPUTS ── */
.field {
  position: relative;
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  appearance: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-dim);
  background: var(--bg2);
}
.field input::placeholder { color: var(--text-muted); }

/* Select arrow */
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--green) 0%, #1ab88a 100%);
  color: #0d1a14;
  box-shadow: 0 4px 20px var(--green-glow);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px var(--green-glow);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-ghost {
  background: var(--bg3);
  color: var(--text-sub);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg2);
  color: var(--text);
  border-color: rgba(255,255,255,0.12);
}

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(248,113,113,0.2);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(248,113,113,0.2);
}

.btn-amber {
  background: rgba(251,191,36,0.12);
  color: var(--amber);
  border: 1px solid rgba(251,191,36,0.2);
}
.btn-amber:hover:not(:disabled) {
  background: rgba(251,191,36,0.2);
}

.btn-blue {
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid rgba(99,179,237,0.2);
}
.btn-blue:hover:not(:disabled) { background: rgba(99,179,237,0.2); }

.btn-full { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: 6px; }

/* ── BADGE ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.badge-green { background: var(--green-dim); color: var(--green); border: 1px solid rgba(34,211,160,0.2); }
.badge-amber { background: rgba(251,191,36,0.1); color: var(--amber); border: 1px solid rgba(251,191,36,0.2); }
.badge-red   { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248,113,113,0.2); }

/* ── DIVIDER ── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-muted);
  font-size: 12px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── LINK ── */
a { color: var(--green); text-decoration: none; transition: opacity 0.15s; }
a:hover { opacity: 0.75; }

/* ── TOAST ── */
#toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast-msg {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 18px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  pointer-events: auto;
}
.toast-msg.success { border-left: 3px solid var(--green); }
.toast-msg.error   { border-left: 3px solid var(--red); }
.toast-msg.info    { border-left: 3px solid var(--blue); }

@keyframes toastIn  { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
@keyframes toastOut { from { opacity:1; } to { opacity:0; } }

/* ── SPINNER ── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }
