/* ============================================================
   SecuredShield Wealth — Base CSS
   Design System: Variables, Reset, Typography, Components
   ============================================================ */

:root {
  /* Backgrounds */
  --bg0: #0d1117;
  --bg1: #161b22;
  --bg2: #1c2128;
  --bg3: #21262d;

  /* Borders */
  --b:  #30363d;
  --b2: #444c56;

  /* Text */
  --t1: #e6edf3;
  --t2: #8b949e;
  --t3: #6e7681;

  /* Brand */
  --bl:    #58a6ff;
  --bl2:   #1f6feb;
  --blbg:  #0d2241;

  /* Green */
  --g:   #3fb950;
  --g2:  #238636;
  --gbg: #0d2318;

  /* Red */
  --r:   #f85149;
  --r2:  #b91c1c;
  --rbg: #2d1212;

  /* Amber */
  --am:   #d29922;
  --ambg: #271f0d;

  /* Purple */
  --pu:   #bc8cff;
  --pubg: #1a1230;

  /* Cyan */
  --cy: #79c0ff;

  /* Spacing */
  --radius-sm: 5px;
  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 14px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, 'SF Pro Text', 'Segoe UI', sans-serif;
  background: var(--bg0);
  color: var(--t1);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--bl); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

input, select, textarea, button {
  font-family: inherit;
  font-size: inherit;
}

/* ── Typography ── */
h1 { font-size: 2.8rem; font-weight: 700; letter-spacing: -.5px; line-height: 1.15; }
h2 { font-size: 2rem;   font-weight: 700; line-height: 1.2; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1rem;    font-weight: 600; }

.text-primary { color: var(--t1); }
.text-secondary { color: var(--t2); }
.text-muted { color: var(--t3); }
.text-green { color: var(--g); }
.text-red   { color: var(--r); }
.text-blue  { color: var(--bl); }
.text-amber { color: var(--am); }
.text-purple { color: var(--pu); }
.text-cyan  { color: var(--cy); }
.text-center { text-align: center; }
.font-mono { font-family: 'SF Mono', Consolas, 'Courier New', monospace; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

/* ── Layout Utilities ── */
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4  { gap: 4px; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-14 { gap: 14px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.ml-auto { margin-left: auto; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.grid-6-4 { display: grid; grid-template-columns: 3fr 2fr; gap: 14px; }

/* ── Spacing ── */
.mb-4  { margin-bottom: 4px; }
.mb-6  { margin-bottom: 6px; }
.mb-8  { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }
.mb-12 { margin-bottom: 12px; }
.mb-14 { margin-bottom: 14px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.p-14  { padding: 14px; }
.px-14 { padding-left: 14px; padding-right: 14px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all .15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-sm  { padding: 5px 10px; font-size: 11px; }
.btn-lg  { padding: 11px 24px; font-size: 14px; font-weight: 600; }
.btn-full { width: 100%; padding: 11px; font-size: 13px; }

.btn-primary { background: var(--bl2); color: #fff; }
.btn-primary:hover { background: #388bfd; }
.btn-green { background: var(--g2); color: #fff; }
.btn-green:hover { background: #2ea043; }
.btn-danger { background: var(--r2); color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-amber { background: #854f0b; color: var(--am); }
.btn-amber:hover { background: #633806; }
.btn-ghost { background: transparent; color: var(--t1); border: 1px solid var(--b); }
.btn-ghost:hover { background: var(--bg3); }
.btn-purple { background: var(--pubg); color: var(--pu); border: 1px solid var(--pu); }
.btn-purple:hover { background: var(--pu); color: #fff; }

/* ── Form Controls ── */
.form-field { margin-bottom: 12px; }
.form-field label {
  display: block;
  font-size: 10px;
  color: var(--t3);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.input, .select, .textarea {
  width: 100%;
  background: var(--bg0);
  border: 1px solid var(--b);
  border-radius: var(--radius);
  color: var(--t1);
  font-size: 13px;
  padding: 9px 12px;
  transition: border-color .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--bl2);
}
.input::placeholder, .textarea::placeholder { color: var(--t3); }
.select option { background: var(--bg1); }
.textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.input-mono { font-family: 'SF Mono', monospace; font-size: 11px; }
.input.valid   { border-color: var(--g2); }
.input.invalid { border-color: var(--r2); }

/* ── Cards ── */
.card {
  background: var(--bg1);
  border: 1px solid var(--b);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  overflow: hidden;
}
.card-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--b);
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title {
  font-size: 11px;
  color: var(--t2);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 500;
}
.card-body { padding: 14px; }

/* ── KPI Tiles ── */
.kpi {
  background: var(--bg1);
  border: 1px solid var(--b);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.kpi-label { font-size: 10px; color: var(--t3); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.kpi-value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 2px; }
.kpi-sub   { font-size: 11px; color: var(--t3); }

/* ── Tags / Badges ── */
.tag { padding: 2px 7px; border-radius: 3px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.tag-green  { background: var(--gbg);  color: var(--g);  }
.tag-red    { background: var(--rbg);  color: var(--r);  }
.tag-blue   { background: var(--blbg); color: var(--bl); }
.tag-amber  { background: var(--ambg); color: var(--am); }
.tag-purple { background: var(--pubg); color: var(--pu); }
.tag-gray   { background: var(--bg3);  color: var(--t2); }
.tag-cyan   { background: rgba(121,192,255,.12); color: var(--cy); }

.pill { padding: 3px 9px; border-radius: 10px; font-size: 10px; font-weight: 600; }

/* ── Tables ── */
.table { width: 100%; border-collapse: collapse; }
.table th {
  font-size: 10px;
  color: var(--t3);
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid var(--b);
  background: var(--bg2);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .4px;
  white-space: nowrap;
}
.table td {
  padding: 9px 10px;
  font-size: 12px;
  border-bottom: 1px solid var(--b);
  font-variant-numeric: tabular-nums;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg2); }
.table-scroll { overflow-x: auto; }

/* ── Toggle Switch ── */
.toggle {
  width: 34px;
  height: 18px;
  background: var(--bg3);
  border: 1px solid var(--b2);
  border-radius: 9px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background .2s;
}
.toggle.on { background: var(--g2); border-color: var(--g2); }
.toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
}
.toggle.on::after { transform: translateX(16px); }

/* ── Alerts / Notices ── */
.notice {
  padding: 10px 13px;
  border-radius: var(--radius);
  font-size: 11.5px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}
.notice-blue   { background: var(--blbg); border: 1px solid var(--bl2); color: var(--bl); }
.notice-green  { background: var(--gbg);  border: 1px solid var(--g2);  color: var(--g);  }
.notice-red    { background: var(--rbg);  border: 1px solid var(--r2);  color: var(--r);  }
.notice-amber  { background: var(--ambg); border: 1px solid #854f0b;    color: var(--am); }

/* ── Divider Row ── */
.srow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--b);
  font-size: 12px;
}
.srow:last-child { border-bottom: none; }

/* ── Progress Bar ── */
.progress { height: 5px; background: var(--bg3); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width .4s; }
.progress-green  { background: var(--g2);  }
.progress-blue   { background: var(--bl2); }
.progress-red    { background: var(--r2);  }
.progress-amber  { background: #854f0b;   }

/* ── Live dot ── */
.dot-live {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--g);
  flex-shrink: 0;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ── OTP Input ── */
.otp-boxes { display: flex; gap: 8px; justify-content: center; margin: 14px 0; }
.otp-box {
  width: 44px; height: 52px;
  background: var(--bg0);
  border: 2px solid var(--b);
  border-radius: var(--radius);
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--t1);
  font-family: 'SF Mono', monospace;
}
.otp-box:focus { outline: none; border-color: var(--bl2); }

/* ── Sidebar Layout ── */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }
.app-body  { display: flex; flex: 1; }
.sidebar {
  width: 200px;
  background: var(--bg1);
  border-right: 1px solid var(--b);
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  flex-shrink: 0;
}
.sidebar-label {
  font-size: 10px;
  color: var(--t3);
  padding: 10px 12px 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  color: var(--t2);
  margin: 1px 6px;
  transition: all .12s;
}
.sidebar-item:hover { background: var(--bg2); color: var(--t1); }
.sidebar-item.active { background: var(--bg3); color: var(--bl); }
.sidebar-badge { margin-left: auto; font-size: 9px; padding: 1px 5px; border-radius: 8px; }
.main-content { flex: 1; overflow-y: auto; background: var(--bg0); }
.page { display: none; padding: 18px; }
.page.active { display: block; }

/* ── Topbar ── */
.topbar {
  background: var(--bg1);
  border-bottom: 1px solid var(--b);
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 0;
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-right: 14px;
  border-right: 1px solid var(--b);
  margin-right: 8px;
}
.brand-icon {
  width: 28px; height: 28px;
  background: var(--bl2);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-tab {
  padding: 0 12px;
  height: 44px;
  display: flex;
  align-items: center;
  font-size: 12px;
  color: var(--t2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  gap: 5px;
  transition: all .12s;
  white-space: nowrap;
  text-decoration: none;
}
.nav-tab:hover { color: var(--t1); background: rgba(255,255,255,.03); }
.nav-tab.active { color: var(--bl); border-bottom-color: var(--bl); }
.nav-tab.admin-tab { color: var(--r); }
.nav-tab.admin-tab.active { border-bottom-color: var(--r); }

/* ── Fee Table Row ── */
.fee-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--b);
  font-size: 12px;
}
.fee-row:last-child { border-bottom: none; }
.fee-label { width: 160px; color: var(--t2); flex-shrink: 0; }
.fee-input {
  width: 80px;
  background: var(--bg0);
  border: 1px solid var(--b);
  border-radius: 5px;
  color: var(--t1);
  font-size: 12px;
  padding: 5px 8px;
  font-family: 'SF Mono', monospace;
  text-align: right;
}
.fee-input:focus { outline: none; border-color: var(--bl2); }
.fee-note { font-size: 10px; color: var(--t3); }

/* ── Ticker Bar ── */
.ticker-bar { background: var(--bg1); border-top: 1px solid var(--b); border-bottom: 1px solid var(--b); padding: 10px 0; overflow: hidden; }
.ticker-inner { display: flex; white-space: nowrap; animation: ticker 20s linear infinite; }
@keyframes ticker { 0%{transform:translateX(0)} 100%{transform:translateX(-50%)} }
.ticker-item { padding: 0 22px; font-size: 12px; border-right: 1px solid var(--b); display: inline-flex; align-items: center; gap: 6px; }

/* ── Notification Items ── */
.notif-item {
  display: flex;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--b);
  cursor: pointer;
  transition: background .12s;
}
.notif-item:hover { background: var(--bg2); }
.notif-item.unread { border-left: 3px solid var(--bl); background: rgba(31,111,235,.04); }
.notif-item:not(.unread) { border-left: 3px solid transparent; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.notif-title { font-size: 12px; font-weight: 500; margin-bottom: 2px; }
.notif-msg { font-size: 11px; color: var(--t3); line-height: 1.4; }
.notif-time { font-size: 10px; color: var(--t3); margin-top: 3px; }

/* ── Bot Card ── */
.bot-card {
  background: var(--bg1);
  border: 1px solid var(--b);
  border-radius: 10px;
  padding: 14px;
  transition: border-color .15s;
}
.bot-card.running { border-left: 3px solid var(--g);  }
.bot-card.paused  { border-left: 3px solid var(--am); }
.bot-card.stopped { border-left: 3px solid var(--r);  }
.bot-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: var(--bg0);
  border: 1px solid var(--b);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 10px;
}
.bot-stat { text-align: center; }
.bot-stat-value { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bot-stat-label { font-size: 10px; color: var(--t3); margin-top: 1px; }

/* ── Address Display ── */
.addr-display {
  background: var(--bg0);
  border: 1px solid var(--b);
  border-radius: 7px;
  padding: 10px 12px;
  font-family: 'SF Mono', monospace;
  font-size: 11px;
  word-break: break-all;
  color: var(--bl);
  margin-bottom: 10px;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.copy-btn {
  flex-shrink: 0;
  padding: 3px 8px;
  background: var(--bg3);
  border: 1px solid var(--b);
  border-radius: 4px;
  font-size: 10px;
  cursor: pointer;
  color: var(--t2);
  font-family: inherit;
  transition: all .15s;
  white-space: nowrap;
}
.copy-btn:hover { border-color: var(--bl); color: var(--bl); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-6-4 { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  h1 { font-size: 2rem; }
  .hero-title { font-size: 2rem; }
}

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
