/* ============================================================
   MRC CEO Console — visual language derived from the partner
   funnel (Poppins, blue-slate ink #1b2b44, azure #1767db,
   fluoro highlighter #8adcff, soft radial glows) reshaped into
   the console layout: dark ink sidebar + light glass workspace.
   ============================================================ */

:root {
  --blue: #1767db;
  --blue-deep: #1060d0;
  --hi: #8adcff;
  --ink: #1b2b44;
  --grey: #505051;
  --grey-lt: #9a9a9c;
  --card-line: #d7e9fa;
  --red: #d64545;
  --side-bg-a: #12203a;
  --side-bg-b: #0d182c;
  --side-text: #b9cbe4;
  --side-dim: #5d7397;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Poppins", -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 72% -8%, rgba(48, 176, 240, 0.16), transparent 62%),
    radial-gradient(900px 480px at 12% 110%, rgba(23, 103, 219, 0.10), transparent 60%),
    #f6f9fd;
  min-height: 100svh;
}

/* ---------- App layout (console) ---------- */
.app { display: flex; min-height: 100svh; visibility: hidden; }
.app.ready { visibility: visible; }

.side {
  width: 236px;
  flex: 0 0 236px;
  background: linear-gradient(180deg, var(--side-bg-a), var(--side-bg-b));
  color: var(--side-text);
  padding: 20px 14px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100svh;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 0; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand-name { font-size: 12.5px; font-weight: 700; color: #fff; line-height: 1.25; }
.brand-sub {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--hi);
  text-transform: uppercase;
}

.side-label {
  margin: 26px 8px 8px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--side-dim);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--side-text);
  background: none;
  border: none;
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
}
.nav-item .dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--side-dim);
  flex: 0 0 6px;
}
.nav-item.active { background: rgba(255, 255, 255, 0.09); color: #fff; }
.nav-item.active .dot { background: var(--hi); }

.side-foot {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.side-foot .who { font-size: 10.5px; color: var(--side-dim); line-height: 1.4; }
.side-foot .who b { display: block; color: var(--side-text); font-size: 11px; }
.signout {
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--side-text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}
.signout:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

/* ---------- Main workspace ---------- */
.main { flex: 1; padding: clamp(24px, 4.5vw, 56px) clamp(20px, 4vw, 48px); min-width: 0; }
.main-inner { width: 100%; max-width: 920px; margin: 0 auto; }

.pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  background: #e4f2ff;
  border: 1px solid #c9e6ff;
  border-radius: 999px;
  padding: 5px 13px;
}

.headrow {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
}
h1.display {
  font-size: clamp(34px, 4.6vw, 54px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.02;
}

.range {
  display: inline-flex;
  gap: 2px;
  background: #e9eff7;
  border: 1px solid #dbe6f3;
  border-radius: 999px;
  padding: 3px;
}
.range button {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--grey);
  background: none;
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
}
.range button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(27, 43, 68, 0.10);
}

/* ---------- Data components ---------- */
#content.loading,
.view.loading { opacity: 0.45; pointer-events: none; transition: opacity 0.15s; }

.range-sm button { padding: 5px 12px; font-size: 11.5px; }

.head-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.updated { font-size: 11px; color: var(--grey-lt); }
.refresh-btn {
  font-family: inherit;
  font-size: 16px;
  line-height: 1;
  color: var(--ink);
  background: #fff;
  border: 1px solid #dbe6f3;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(27, 43, 68, 0.08);
}
.refresh-btn:hover { border-color: var(--blue); color: var(--blue); }
.refresh-btn.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey-lt);
  padding: 8px 10px;
  border-bottom: 1px solid #e3edf9;
}
.tbl td {
  padding: 10px;
  border-bottom: 1px solid #eef4fb;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tbl td:first-child { white-space: normal; font-weight: 600; max-width: 320px; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .dim { color: var(--grey-lt); font-weight: 400; }

.banner {
  margin-top: 22px;
  background: #fff7e6;
  border: 1px solid #f2dfb3;
  color: #8a5a00;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
}
.banner + .banner { margin-top: 8px; }

.cards {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}
.card {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid #dce9f8;
  border-radius: 18px;
  padding: 18px 20px 16px;
  box-shadow: 0 8px 28px rgba(27, 43, 68, 0.05);
}
.card-l {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grey-lt);
}
.card-n { font-size: 34px; font-weight: 800; margin-top: 6px; line-height: 1.1; }
.card-n.blue { color: var(--blue); }
.card-s { font-size: 11.5px; color: var(--grey-lt); margin-top: 4px; }

.panel {
  margin-top: 18px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid #dce9f8;
  border-radius: 20px;
  padding: 20px 24px 22px;
  box-shadow: 0 8px 28px rgba(27, 43, 68, 0.05);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.panel-l {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grey-lt);
}
.panel-r { font-size: 11px; color: var(--grey-lt); max-width: 60ch; }

.frow { padding: 9px 0 3px; }
.frow-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
}
.frow-top b { font-weight: 700; }
.fsub { font-size: 11.5px; color: var(--grey-lt); }
.fnum { font-weight: 700; font-variant-numeric: tabular-nums; }
.btrack {
  margin-top: 6px;
  height: 6px;
  border-radius: 999px;
  background: #e9f0f9;
  overflow: hidden;
}
.bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1e79f0, var(--blue-deep));
  transition: width 0.4s ease;
}
.bar.showed { background: linear-gradient(90deg, #2fbf71, #1f9d55); }

.ghl-strip {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed #d8e6f6;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
}
.ghl-strip > div { font-size: 13px; }
.ghl-strip .gl {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey-lt);
}
.ghl-strip b { font-size: 17px; font-weight: 800; }

/* ---------- Landing page preview ---------- */
.dist-track {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #e9f0f9;
  margin: 4px 0 8px;
}
.dist-seg { height: 100%; }
.dist-legend {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--grey);
  margin-bottom: 16px;
}
.dist-l { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.dist-l i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

.lp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.lp-card {
  border: 1px solid #dce9f8;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.65);
  padding: 14px 16px 8px;
}
.lp-cardhead {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.lp-name { font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 7px; }
.lp-dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; }
.lp-url { font-size: 11px; color: var(--grey-lt); flex: 1; }
.lp-open {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
  border: 1px solid #d7e4f3;
  border-radius: 999px;
  padding: 6px 13px;
  box-shadow: 0 2px 8px rgba(27, 43, 68, 0.06);
}
.lp-open:hover { border-color: var(--blue); color: var(--blue); }

.lp-mock {
  background: #fff;
  border: 1px solid #e6eef8;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 22px rgba(27, 43, 68, 0.06);
}
.lp-top {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-bottom: 1px solid #eef4fb;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink);
}
.lp-top img { width: 16px; height: 16px; border-radius: 4px; }
.lp-hero { padding: 20px 22px 22px; text-align: center; }
.lp-h1 {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink);
}
.lp-hi {
  background: linear-gradient(180deg, transparent 52%, var(--hi) 52%);
  padding: 0 2px;
}
.lp-sub {
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--grey);
  max-width: 340px;
  margin: 9px auto 0;
}
.lp-sub b { color: var(--ink); }
.lp-cta {
  display: inline-block;
  margin-top: 12px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, #1e79f0, var(--blue-deep));
  border-radius: 999px;
  padding: 8px 18px;
  box-shadow: 0 6px 16px rgba(23, 103, 219, 0.28);
}
.lp-stats {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 9px;
  color: var(--grey-lt);
}
.lp-stats b { color: var(--ink); font-size: 10.5px; }

.lp-srows { padding: 4px 4px 6px; }
.lp-srow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
  padding: 8px 2px;
  border-bottom: 1px solid #e9f1fa;
}
.lp-srow:last-child { border-bottom: none; }
.lp-srow > span:first-child { font-weight: 600; }
.lp-srow b { font-variant-numeric: tabular-nums; }

/* ---------- Empty state ---------- */
.empty {
  margin-top: 30px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1.5px dashed #c3daf2;
  border-radius: 22px;
  padding: 72px 32px;
  text-align: center;
}
.empty .glyph {
  width: 46px; height: 46px;
  margin: 0 auto 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #e4f2ff, #f4faff);
  border: 1px solid #cfe7fd;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.empty h2 { font-size: 16.5px; font-weight: 700; }
.empty p {
  margin: 8px auto 0;
  max-width: 460px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--grey);
}

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 396px;
  background: #fff;
  border: 1px solid #e3eefb;
  border-radius: 22px;
  padding: 38px 34px 34px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(23, 103, 219, 0.13);
}
.login-card img.logo { width: 46px; height: 46px; border-radius: 12px; }
.login-card h1 { font-size: 17px; font-weight: 700; margin-top: 12px; }
.login-card .pill { margin-top: 8px; }
.login-card form { margin-top: 24px; }
.login-card input {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--card-line);
  border-radius: 12px;
  padding: 13px 15px;
  outline: none;
  transition: border-color 0.12s ease;
}
.login-card input:focus { border-color: var(--blue); }
.login-btn {
  width: 100%;
  margin-top: 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, #1e79f0, var(--blue-deep));
  border: none;
  border-radius: 999px;
  padding: 13px 20px;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(23, 103, 219, 0.30);
}
.login-btn:disabled { opacity: 0.65; cursor: default; }
.login-err {
  display: none;
  margin-top: 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--red);
}
.login-foot { margin-top: 18px; font-size: 11px; color: var(--grey-lt); }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .app { flex-direction: column; }
  .side {
    width: 100%;
    flex: none;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
  }
  .side-label { display: none; }
  .side .nav { display: flex; margin-left: 8px; }
  .nav-item { padding: 7px 10px; }
  .side-foot { margin: 0 0 0 auto; border: none; padding: 0; }
  .side-foot .who { display: none; }
}
