/* ===== Bankify Dashboard — Global Reset & Shared Utilities ===== */

/* --- Reset & base --- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  background: #0a0a0c;
  color: #e5e7eb;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: #f87171; text-decoration: none; transition: color .15s; }
a:hover { color: #fca5a5; }

/* --- Topbar (consistent across all pages) --- */
.topbar {
  background: #121214;
  border-bottom: 1px solid rgba(220,38,38,.4);
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(8px);
}
.topbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
  color: #f5f5f5;
}
.topbar-title .icon { font-size: 20px; }
.topbar-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #18181b;
  border: 1px solid #2b2b31;
  color: #e5e7eb;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { background: #1f1f24; border-color: #ef4444; }
.btn-primary {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}
.btn-primary:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-ghost {
  background: transparent;
  border-color: #3f3f46;
  color: #d4d4d8;
}
.btn-ghost:hover { border-color: #71717a; color: #fff; }
.btn-danger { border-color: #ef4444; color: #fca5a5; }
.btn-danger:hover { background: rgba(239,68,68,.15); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }

/* --- Inputs --- */
.input {
  background: #101013;
  border: 1px solid #2b2b31;
  color: #e5e7eb;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
}
.input:focus { border-color: #ef4444; }
.input::placeholder { color: #71717a; }
textarea.input { min-height: 80px; resize: vertical; }
select.input { min-width: 160px; }

/* --- Pills / badges --- */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  background: #3f3f46;
}
.pill.protected { background: #7c3aed; }
.pill.disabled { background: #ef4444; }
.pill.chance { background: #7c3aed; }
.pill.reward { background: #f59e0b; color: #000; }
.pill.role { background: #7c3aed; }
.pill.type { background: #7c3aed; }
.pill.amount { background: #f59e0b; color: #000; }
.pill.past { background: #ef4444; }
.pill.current { background: #7c3aed; }
.pill.upcoming { background: #22c55e; }

/* --- Toast notifications --- */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #18181b;
  color: #e5e7eb;
  border: 1px solid #2b2b31;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  z-index: 100;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.toast.ok { border-color: #16a34a; }
.toast.err { border-color: #ef4444; }

/* --- Toggle switch --- */
.switch { --w: 46px; --h: 26px; position: relative; width: var(--w); height: var(--h); flex-shrink: 0; }
.switch input { appearance: none; -webkit-appearance: none; width: 100%; height: 100%; outline: none; cursor: pointer; }
.track { position: absolute; inset: 0; background: #1e1e24; border: 1px solid #3f3f46; border-radius: 999px; transition: background .15s, border-color .15s; }
.thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #ef4444; transition: left .18s ease, background .15s, box-shadow .15s; box-shadow: 0 0 6px rgba(239,68,68,.5); }
.switch input:checked ~ .track { background: #052e16; border-color: #166534; }
.switch input:checked ~ .thumb { left: calc(var(--w) - 23px); background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,.6); }

/* --- Hint text --- */
.hint { color: #71717a; font-size: 12px; }

/* --- Canvas background (shared across pages) --- */
#bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* --- Scrollbar styling --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0a0a0c; }
::-webkit-scrollbar-thumb { background: #2b2b31; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3f3f46; }
