/* ===================================================================
   Silvereye — design system (dark emerald glass, premium fintech)
   =================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #040806;
  --bg-2: #071009;
  --surface: rgba(11, 20, 15, 0.68);
  --surface-2: rgba(16, 28, 21, 0.74);
  --border: rgba(180, 230, 205, 0.07);
  --border-glow: rgba(31, 168, 116, 0.3);
  --text: #E4EFE8;
  --muted: #86A093;
  --faint: #556B5F;

  --brand: #22B383;
  --brand-2: #0C8F5F;
  --teal: #17A88F;
  --gold: #E9AC45;   /* BTC */
  --sky: #38BDF8;    /* ZAR */
  --violet: #A78BFA; /* GBP */
  --orange: #FB923C; /* EUR */
  --pos: #2BC38F;
  --neg: #F1687F;

  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --r: 18px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

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

html, body {
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  font-variant-numeric: tabular-nums;
  background:
    radial-gradient(140vw 90vh at 50% -18%, #0a281c 0%, #06130d 44%, #030706 100%) fixed;
}

/* Animated gradient-mesh background (shared) — transparent, only holds the blobs */
.bg-mesh {
  position: fixed; inset: 0; z-index: -2; overflow: hidden;
}
.bg-mesh::before, .bg-mesh::after {
  content: ""; position: absolute; border-radius: 50%;
  filter: blur(70px);
}
.bg-mesh::before {
  width: 58vw; height: 58vw; left: -12vw; top: -16vw; opacity: 0.55;
  background: radial-gradient(circle, rgba(13,120,84,0.62), transparent 66%);
  animation: drift1 26s ease-in-out infinite alternate;
}
.bg-mesh::after {
  width: 52vw; height: 52vw; right: -14vw; bottom: -16vw; opacity: 0.48;
  background: radial-gradient(circle, rgba(16,140,116,0.5), transparent 66%);
  animation: drift2 32s ease-in-out infinite alternate;
}

/* Richer gradient specifically behind the login (landing) */
.login-wrap::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vw 55vh at 50% 30%, rgba(15,135,92,0.42), transparent 58%),
    radial-gradient(48vw 46vh at 76% 72%, rgba(17,145,120,0.32), transparent 60%),
    radial-gradient(46vw 46vh at 22% 76%, rgba(18,112,78,0.26), transparent 60%);
  animation: sheen 20s ease-in-out infinite alternate;
}
@keyframes sheen { to { filter: hue-rotate(14deg) brightness(1.15); transform: scale(1.06); } }
.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.35;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}
@keyframes drift1 { to { transform: translate(8vw, 6vw) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-6vw, -5vw) scale(1.1); } }

/* ---------- Logo ---------- */
.logo {
  border-radius: 50%; object-fit: cover; object-position: 30% 24%;
  border: 1.5px solid var(--border-glow);
  box-shadow: 0 0 0 4px rgba(52,211,153,0.08), 0 6px 20px rgba(0,0,0,0.45);
}
.brand-name { font-family: var(--font-display); font-weight: 700; letter-spacing: .16em; }
.brand-sub { color: var(--muted); font-size: .58rem; letter-spacing: .3em;
  text-transform: uppercase; font-weight: 600; }

/* =================== LOGIN =================== */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.login-card {
  width: 100%; max-width: 400px; padding: 40px 34px;
  background: var(--surface); backdrop-filter: blur(22px);
  border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow);
  text-align: center; animation: rise .7s cubic-bezier(.2,.8,.2,1) both;
}
.login-card .logo { width: 92px; height: 92px; margin: 0 auto 18px; }
.login-card h1 { font-family: var(--font-display); font-size: 1.8rem; letter-spacing: .18em; }
.login-card .tag { color: var(--muted); font-size: .62rem; letter-spacing: .34em;
  text-transform: uppercase; margin-top: 6px; margin-bottom: 26px; font-weight: 600; }
.field { text-align: left; margin-bottom: 14px; }
.field label { display: block; font-size: .72rem; color: var(--muted); margin-bottom: 6px;
  font-weight: 600; letter-spacing: .04em; }
.field input {
  width: 100%; padding: 13px 15px; border-radius: 12px; font-size: .95rem;
  background: rgba(0,0,0,0.25); border: 1px solid var(--border); color: var(--text);
  font-family: var(--font-body); transition: border-color .2s, box-shadow .2s;
}
.field input:focus { outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(52,211,153,0.16); }
.btn {
  width: 100%; padding: 13px; border: none; border-radius: 12px; cursor: pointer;
  font-family: var(--font-body); font-weight: 700; font-size: .95rem; color: #04140E;
  background: linear-gradient(135deg, var(--brand), var(--teal));
  transition: transform .15s ease, box-shadow .2s ease; margin-top: 8px;
  box-shadow: 0 6px 18px rgba(16,185,129,0.35);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(16,185,129,0.45); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.login-err { color: var(--neg); font-size: .82rem; margin-top: 14px; min-height: 18px; }

/* =================== APP SHELL =================== */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px; padding: 14px 26px;
  background: rgba(7,11,10,0.72); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.topbar .logo { width: 40px; height: 40px; }
.topbar .brand-name { font-size: 1.15rem; }
.spacer { flex: 1; }
.asof { color: var(--faint); font-size: .74rem; text-align: right; line-height: 1.35; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand);
  display: inline-block; margin-right: 5px; box-shadow: 0 0 8px var(--brand);
  animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.seg { display: inline-flex; background: rgba(0,0,0,0.3); border: 1px solid var(--border);
  border-radius: 10px; padding: 3px; }
.seg button { border: none; background: none; color: var(--muted); cursor: pointer;
  padding: 6px 12px; border-radius: 7px; font-weight: 600; font-size: .8rem;
  font-family: var(--font-body); transition: all .2s; }
.seg button.on { background: linear-gradient(135deg, var(--brand), var(--teal)); color: #04140E; }
.icon-btn { background: rgba(0,0,0,0.3); border: 1px solid var(--border); color: var(--muted);
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer; display: grid;
  place-items: center; transition: all .2s; }
.icon-btn:hover { color: var(--brand); border-color: var(--border-glow); }

.tabs { display: flex; gap: 4px; padding: 10px 22px 0; border-bottom: 1px solid var(--border);
  overflow-x: auto; }
.tabs button { border: none; background: none; color: var(--muted); cursor: pointer;
  padding: 10px 15px; font-weight: 600; font-size: .86rem; font-family: var(--font-body);
  border-bottom: 2px solid transparent; white-space: nowrap; transition: color .2s; }
.tabs button.on { color: var(--text); border-bottom-color: var(--brand); }

.container { max-width: 1240px; margin: 0 auto; padding: 24px 22px 60px; }
.panel { display: none; }
.panel.on { display: block; animation: fade .35s ease both; }

/* ---------- cards / grid ---------- */
.grid { display: grid; gap: 16px; }
.kpi-row { grid-template-columns: repeat(4, 1fr); }
.kpi-row.five { grid-template-columns: repeat(5, 1fr); }
.two { grid-template-columns: 1.6fr 1fr; }
@media (max-width: 900px) { .kpi-row, .kpi-row.five, .two { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .kpi-row, .kpi-row.five, .two { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: var(--r); padding: 18px 20px;
  box-shadow: var(--shadow); animation: rise .6s cubic-bezier(.2,.8,.2,1) both;
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover { border-color: var(--border-glow); }
.card.lift:hover { transform: translateY(-3px); }
.kpi .label { color: var(--muted); font-size: .7rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; }
.kpi .value { font-size: 1.7rem; font-weight: 700; margin-top: 5px; font-variant-numeric: tabular-nums; }
.kpi.hero .value { font-size: 2.2rem;
  background: linear-gradient(135deg, #fff, var(--brand)); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; }
.kpi .delta { font-size: .84rem; font-weight: 600; margin-top: 3px; }
.pos { color: var(--pos); } .neg { color: var(--neg); } .mut { color: var(--muted); }

.section-title { font-family: var(--font-display); font-weight: 600; font-size: 1rem;
  margin: 4px 0 10px; letter-spacing: .01em; }
.note { color: var(--faint); font-size: .78rem; margin-top: 2px; }
.chart { width: 100%; height: 320px; }
.chart.tall { height: 380px; }
.chart.short { height: 220px; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { text-align: right; padding: 9px 12px; border-bottom: 1px solid var(--border); }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 600; font-size: .74rem; text-transform: uppercase;
  letter-spacing: .04em; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: rgba(52,211,153,0.05); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .72rem;
  font-weight: 600; }

/* staggered reveal helper */
.stagger > * { animation: rise .6s cubic-bezier(.2,.8,.2,1) both; }
.stagger > *:nth-child(1){animation-delay:.03s}.stagger > *:nth-child(2){animation-delay:.08s}
.stagger > *:nth-child(3){animation-delay:.13s}.stagger > *:nth-child(4){animation-delay:.18s}
.stagger > *:nth-child(5){animation-delay:.23s}

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.sel { width: 100%; padding: 12px 14px; border-radius: 11px; background: rgba(0,0,0,0.28);
  border: 1px solid var(--border); color: var(--text); font-family: var(--font-body); }
.sel:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(34,179,131,0.16); }
.task-form { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 12px; align-items: end; }
@media (max-width: 760px) { .task-form { grid-template-columns: 1fr 1fr; } }
.task { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 12px; margin-bottom: 8px; background: var(--surface-2); }
.task .t-title { font-weight: 600; }
.task .t-meta { color: var(--muted); font-size: .76rem; margin-top: 2px; }
.task.done .t-title { text-decoration: line-through; color: var(--muted); }
.t-actions { margin-left: auto; display: flex; gap: 6px; }
.t-actions button { background: rgba(0,0,0,0.3); border: 1px solid var(--border); color: var(--muted);
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.t-actions button:hover { color: var(--brand); border-color: var(--border-glow); }
.badge { padding: 2px 8px; border-radius: 999px; font-size: .7rem; font-weight: 600; }
.mkt-card { padding: 14px 16px; }
.mkt-card h4 { font-family: var(--font-display); font-size: .95rem; margin-bottom: 8px; }
.mkt-card table { font-size: .76rem; }
.mkt-card th, .mkt-card td { padding: 6px 8px; }

.doc h3 { font-family: var(--font-display); font-size: .96rem; margin: 20px 0 6px; color: var(--text); }
.doc p { margin-bottom: 6px; line-height: 1.55; }
.doc pre { background: rgba(0,0,0,0.4); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; overflow-x: auto; font-size: .78rem; color: var(--text);
  font-family: ui-monospace, Menlo, Consolas, monospace; margin: 6px 0 4px; }
.doc code { background: rgba(0,0,0,0.4); padding: 1px 6px; border-radius: 6px;
  font-family: ui-monospace, monospace; font-size: .86em; color: var(--brand); }
.doc a { color: var(--brand); }
.doc-table td { text-align: left; vertical-align: top; }
.doc-table td:first-child { font-family: ui-monospace, monospace; color: var(--brand); white-space: nowrap; }
@media (max-width: 700px) { .doc-table td:first-child { white-space: normal; } }

.hidden { display: none !important; }
::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
