/* =====================================================================
   Copy Mend - Stylesheet
   Brand: blue accent (#2D7FE5) on dark canvas
   ===================================================================== */

:root {
  --bg: #07090F;
  --bg-2: #0C111B;
  --bg-3: #121826;
  --surface: #151B2A;
  --surface-2: #1B2233;
  --border: #232B40;
  --border-soft: #1B2233;

  --text: #EAF0FA;
  --text-muted: #8A93A6;
  --text-dim: #5C6477;

  --brand: #2D7FE5;
  --brand-2: #4FA0FF;
  --brand-3: #1A5FB4;
  --brand-glow: rgba(45, 127, 229, 0.35);

  --pos: #21D07A;
  --pos-soft: rgba(33, 208, 122, 0.15);
  --neg: #F25C5C;
  --neg-soft: rgba(242, 92, 92, 0.15);

  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 12px 40px rgba(0,0,0,.45);
  --shadow-lg: 0 30px 80px rgba(0,0,0,.55);

  --container: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.text-gradient {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }

/* =============== BUTTONS =============== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .01em;
  transition: all .2s ease;
  white-space: nowrap;
}
.btn--lg { padding: 16px 30px; font-size: 16px; }
.btn--primary {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff;
  box-shadow: 0 10px 30px var(--brand-glow);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px var(--brand-glow);
}
.btn--ghost {
  background: rgba(255,255,255,.04);
  color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover { background: rgba(255,255,255,.08); border-color: var(--brand); }

/* =============== NAV (admin only) =============== */
.nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -.01em;
}
.nav__logo {
  width: 36px; height: 36px; border-radius: 8px;
  object-fit: cover;
  background: #fff;
}
.nav__name {
  background: linear-gradient(135deg, #fff, #b5cdf2);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* =============== HERO BRAND =============== */
.hero__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 26px;
}
.hero__brand-logo {
  height: 64px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(45,127,229,.25));
}
@media (max-width: 720px) {
  .hero__brand-logo { height: 52px; max-width: 230px; }
}

/* =============== HERO =============== */
.hero {
  position: relative;
  padding: 80px 0 60px;
  overflow: hidden;
  isolation: isolate;
}
.hero__bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(900px 500px at 15% 0%, rgba(45,127,229,.20), transparent 60%),
    radial-gradient(700px 500px at 100% 50%, rgba(79,160,255,.12), transparent 60%);
  z-index: -1;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  z-index: -1;
}
.hero__inner { display: flex; align-items: center; }
.hero__content { max-width: 820px; margin: 0 auto; text-align: center; }
.hero__badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(45,127,229,.10);
  border: 1px solid rgba(45,127,229,.3);
  font-size: 13px; color: var(--brand-2); font-weight: 500;
  margin-bottom: 24px;
}
.dot { width: 8px; height: 8px; background: var(--pos); border-radius: 50%; box-shadow: 0 0 10px var(--pos); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity:1 } 50% { opacity:.4 } }
.hero__title {
  font-size: clamp(36px, 6vw, 68px);
  line-height: 1.05;
  letter-spacing: -.02em;
  margin: 0 0 22px;
  font-weight: 800;
}
.hero__subtitle {
  font-size: clamp(16px, 1.4vw, 20px);
  color: var(--text-muted);
  margin: 0 auto 36px;
  max-width: 620px;
}
.hero__cta {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 48px;
}
.hero__meta {
  display: flex; gap: 36px; flex-wrap: wrap; justify-content: center;
  color: var(--text-muted); font-size: 14px;
}
.hero__meta strong { color: var(--text); font-weight: 700; }

/* =============== SECTIONS =============== */
.section { padding: 80px 0; }
.section--alt { background: linear-gradient(180deg, transparent, rgba(45,127,229,.04)); }
.section__head { text-align: center; margin-bottom: 50px; }
.section__head h2 {
  font-size: clamp(28px, 3.5vw, 42px);
  line-height: 1.15;
  letter-spacing: -.02em;
  margin: 8px 0 12px;
  font-weight: 800;
}
.section__head p { color: var(--text-muted); max-width: 620px; margin: 0 auto; }
.eyebrow {
  display: inline-block;
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brand-2);
}

/* =============== KPI GRID =============== */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.kpi {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: transform .25s ease, border-color .25s ease;
}
.kpi:hover { transform: translateY(-3px); border-color: rgba(45,127,229,.45); }
.kpi__label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: 10px;
}
.kpi__value {
  display: block;
  font-size: 28px; font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.02em;
}
.kpi__sub {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 500;
}
.kpi--hero {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(45,127,229,.18), rgba(79,160,255,.06));
  border-color: rgba(45,127,229,.5);
}
.kpi--hero .kpi__value { font-size: 44px; }

/* =============== CHART CARD =============== */
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow);
}

/* =============== MONTHLY =============== */
.monthly-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  align-items: stretch;
}
.monthly-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-height: 480px;
  overflow-y: auto;
}
.monthly-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.monthly-table th, .monthly-table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
}
.monthly-table thead th {
  background: var(--surface-2);
  font-weight: 600; font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em;
  position: sticky; top: 0;
}
.monthly-table .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.monthly-table tbody tr:hover { background: rgba(255,255,255,.02); }

/* =============== OPS TABLE =============== */
.ops-toolbar {
  display: flex; gap: 16px; align-items: center;
  margin-bottom: 18px; flex-wrap: wrap;
}
.input {
  flex: 1; min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}
.input:focus { border-color: var(--brand); }
.ops-summary { display: flex; gap: 18px; color: var(--text-muted); font-size: 14px; }
.ops-summary strong { color: var(--text); font-weight: 700; }

.ops-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.ops-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ops-table th, .ops-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
}
.ops-table thead th {
  background: var(--surface-2);
  font-weight: 600; font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em;
}
.ops-table tbody tr:hover { background: rgba(255,255,255,.02); }
.ops-table .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.ops-table .empty { text-align: center; color: var(--text-muted); padding: 40px; }

.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 700;
  letter-spacing: .04em;
}
.pill--buy { background: var(--pos-soft); color: var(--pos); }
.pill--sell { background: var(--neg-soft); color: var(--neg); }

/* =============== STEPS =============== */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 50px;
}
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
}
.step__num {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  font-weight: 800;
  margin-bottom: 14px;
  color: #fff;
}
.step h3 { margin: 0 0 8px; font-size: 19px; font-weight: 700; }
.step p { margin: 0; color: var(--text-muted); font-size: 15px; }

/* =============== CTA CARD =============== */
.cta-card {
  background: linear-gradient(135deg, rgba(45,127,229,.15), rgba(79,160,255,.04));
  border: 1px solid rgba(45,127,229,.4);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}
.cta-card h3 { margin: 0 0 6px; font-size: 24px; font-weight: 800; }
.cta-card p { margin: 0; color: var(--text-muted); }
.cta-card > div { flex: 1; min-width: 260px; }

/* =============== FOOTER =============== */
.footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border-soft);
  padding: 50px 0 30px;
  margin-top: 50px;
}
.footer__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.6fr;
  gap: 30px;
  align-items: start;
}
.footer__brand { display: flex; align-items: center; gap: 14px; }
.footer__logo { width: 44px; height: 44px; border-radius: 10px; background: #fff; }
.footer__brand strong { display: block; font-size: 18px; }
.footer__tag { color: var(--text-muted); font-size: 13px; }
.footer__links { display: flex; flex-direction: column; gap: 8px; color: var(--text-muted); }
.footer__links a:hover { color: var(--text); }
.footer__legal { font-size: 13px; }
.footer__legal p { margin: 0 0 6px; }

/* =============== ADMIN PAGES =============== */
.admin-body {
  display: flex; min-height: 100vh;
  background: var(--bg);
}
.admin-sidebar {
  width: 240px;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 24px 18px;
  display: flex; flex-direction: column;
}
.admin-sidebar .nav__brand { padding: 0 6px 24px; border-bottom: 1px solid var(--border-soft); }
.admin-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 18px; flex: 1; }
.admin-nav a {
  padding: 10px 12px; border-radius: 8px;
  color: var(--text-muted); font-weight: 500; font-size: 14px;
  transition: all .15s;
}
.admin-nav a:hover { background: rgba(255,255,255,.04); color: var(--text); }
.admin-nav a.active { background: rgba(45,127,229,.15); color: var(--brand-2); }
.admin-main { flex: 1; padding: 32px 40px; overflow-x: auto; }
.admin-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px; flex-wrap: wrap; gap: 16px;
}
.admin-header h1 { margin: 0; font-size: 26px; font-weight: 800; }
.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
}
.admin-card h2 { margin: 0 0 18px; font-size: 18px; font-weight: 700; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 14px; }
.form-row label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted); font-weight: 500; }
.form-row input, .form-row select, .form-row textarea {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--brand); }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert--ok { background: var(--pos-soft); color: var(--pos); border: 1px solid rgba(33,208,122,.3); }
.alert--err { background: var(--neg-soft); color: var(--neg); border: 1px solid rgba(242,92,92,.3); }

.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(800px 600px at 50% -20%, rgba(45,127,229,.20), transparent 60%),
    var(--bg);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
}
.login-card .nav__brand { justify-content: center; margin-bottom: 22px; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn--sm { padding: 7px 14px; font-size: 13px; }
.btn--danger { background: rgba(242,92,92,.15); color: var(--neg); border: 1px solid rgba(242,92,92,.3); }
.btn--danger:hover { background: rgba(242,92,92,.25); }
.btn--block { width: 100%; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td {
  padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border-soft);
}
.admin-table thead th {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .08em;
}
.admin-table tbody tr:hover { background: rgba(255,255,255,.02); }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* =============== RESPONSIVE =============== */
@media (max-width: 980px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi--hero { grid-column: span 2; }
  .kpi--hero .kpi__value { font-size: 36px; }
  .monthly-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .hero { padding: 50px 0 30px; }
  .section { padding: 50px 0; }
  .kpis { grid-template-columns: 1fr; }
  .kpi--hero { grid-column: span 1; }
  .cta-card { padding: 26px; }
  .admin-sidebar { display: none; }
  .admin-main { padding: 24px 18px; }
  .ops-table thead, .monthly-table thead { display: none; }
  .ops-table td, .monthly-table td { padding: 8px 14px; }
}
