/* OrangeX Auto — Solar Light theme.
   Colors are centralized so an OrangeX -> WOWX rebrand only touches :root. */
:root {
  --brand: #FF6A00;
  --brand-bright: #FF8A3D;
  --brand-soft: #FFF6EF;
  --brand-border: #FFE2CC;

  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --surface-alt: #FFF6EF;
  --border: #EDEFF3;
  --ink: #14181F;
  --muted: #8A9099;
  --muted-2: #A2A8B0;

  --pos: #12B981;
  --neg: #EF4757;

  --radius: 18px;
  --radius-sm: 11px;
  --page-pad: 18px;
  --nav-h: 72px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); }
body {
  font-family: var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
#app {
  max-width: 540px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0));
}

/* Header */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px var(--page-pad) 12px;
}
.brand { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.subtitle { font-size: 12px; color: var(--muted); margin-top: 2px; }
.status-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--muted-2); box-shadow: 0 0 0 4px rgba(0,0,0,0.03);
}
.status-dot.active { background: var(--pos); box-shadow: 0 0 0 4px rgba(18,185,129,0.15); }

/* Pages */
.page { padding: 0 var(--page-pad); }
.page.hidden { display: none; }
.hidden { display: none !important; }

/* Hero */
.hero-card {
  position: relative;
  background: linear-gradient(135deg, var(--brand-bright), #FF5E1A);
  color: #fff; border-radius: 22px; padding: 22px;
  box-shadow: 0 12px 30px rgba(255,106,0,0.25);
  margin-top: 8px;
}
.hero-card.soft {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--brand-border); box-shadow: none;
}
.hero-label { font-size: 12px; font-weight: 600; opacity: 0.9; }
.hero-card.soft .hero-label { color: var(--brand); opacity: 1; }
.hero-value { font-size: 34px; font-weight: 800; margin-top: 6px; letter-spacing: -0.02em; }
.hero-value.sm { font-size: 22px; }
.hero-sub { font-size: 13px; margin-top: 8px; opacity: 0.95; }
.hero-card.soft .hero-sub { color: var(--muted); }
.badge {
  position: absolute; top: 20px; right: 20px;
  background: rgba(255,255,255,0.22); color: #fff;
  font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 13px;
}
.badge.live { background: rgba(255,255,255,0.28); }

/* Tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.tile-label { font-size: 11px; color: var(--muted); }
.tile-value { font-size: 24px; font-weight: 800; margin-top: 8px; }
.tile-value.pos { color: var(--pos); }

/* Sections + cards */
.section-title { font-size: 14px; font-weight: 800; margin: 22px 0 10px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 10px; }
.card-title { font-size: 14px; font-weight: 700; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--muted); font-size: 12px; }
.muted.small { font-size: 11px; margin-top: 6px; line-height: 1.4; }
.divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.grow { flex: 1; }

/* Lists */
.list { display: flex; flex-direction: column; gap: 8px; }
.empty { color: var(--muted-2); font-size: 13px; padding: 8px 2px; }
.pos-item, .member-item, .pending-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.pos-item .sym, .member-item .name { font-weight: 700; font-size: 13px; }
.pos-item .meta, .member-item .meta { color: var(--muted); font-size: 11px; margin-top: 3px; }
.pnl.pos { color: var(--pos); font-weight: 800; }
.pnl.neg { color: var(--neg); font-weight: 800; }

/* Fields + buttons */
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.field span { font-size: 12px; color: var(--muted); }
.field input, .field select {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; font-size: 14px; font-family: var(--font); background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.btn {
  border: none; border-radius: var(--radius-sm); padding: 12px 16px;
  font-size: 14px; font-weight: 700; font-family: var(--font); cursor: pointer;
  margin-top: 12px; transition: transform 0.05s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--brand-bright), var(--brand)); color: #fff; }
.btn.ghost { background: var(--brand-soft); color: var(--brand); border: 1px solid var(--brand-border); }
.btn.sm { padding: 9px 12px; margin-top: 0; }
.feedback { font-size: 12px; margin-top: 10px; min-height: 16px; }
.feedback.ok { color: var(--pos); }
.feedback.err { color: var(--neg); }

.copy-row { display: flex; gap: 8px; margin-top: 10px; }
.copy-row input { flex: 1; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; font-size: 12px; }

/* Switch */
.switch { position: relative; display: inline-block; width: 50px; height: 30px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: #D6DAE0; border-radius: 30px; transition: 0.2s; }
.slider::before { content: ""; position: absolute; height: 24px; width: 24px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: 0.2s; }
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* Bottom nav */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  max-width: 540px; margin: 0 auto; height: var(--nav-h);
  background: rgba(255,255,255,0.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
  background: none; border: none; font-family: var(--font);
  font-size: 11px; color: #777F8B; cursor: pointer;
  flex: 1; min-height: 56px; justify-content: center; padding: 6px 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.nav-item.active { color: var(--brand); font-weight: 700; }
.nav-icon { width: 23px; height: 23px; flex-shrink: 0; }
.nav-item.active .nav-icon { stroke-width: 2.1; }
.nav-item:focus-visible { outline: 2px solid var(--brand); outline-offset: -4px; border-radius: 10px; }

/* Toast */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 16px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px;
  font-size: 13px; z-index: 50; max-width: 88%; text-align: center;
}
