/* Profrakt Partnerportal — demo styling.
 *
 * One stylesheet for the whole portal. The palette and shapes follow the
 * approved design frames (login, admin dashboard, leads, seller home,
 * register lead). All UI copy is Norwegian by design; see the site README.
 */

:root {
  --bg: #f4f1fb;
  --card: #ffffff;
  --line: #ece6f6;
  --line-2: #e2dbf2;

  --ink: #231a3a;
  --ink-2: #4a415f;
  --muted: #8b84a0;

  --brand: #7c5cfc;
  --brand-strong: #6a48f5;
  --brand-deep: #2d1b4e;
  --brand-soft: #f1edfe;
  --brand-softer: #f8f5ff;

  --side-top: #2a183f;
  --side-bottom: #1c102d;

  --green: #12b76a;
  --green-bg: #e7f8f0;
  --orange: #f79009;
  --orange-bg: #fdf0dd;
  --red: #f04438;
  --red-bg: #fdeae8;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(35, 26, 58, 0.05), 0 10px 30px -14px rgba(64, 44, 130, 0.14);
  --shadow-soft: 0 1px 2px rgba(35, 26, 58, 0.04), 0 6px 18px -10px rgba(64, 44, 130, 0.1);

  --font-display: "Poppins", "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button { font-family: inherit; }

/* Icons injected into <span data-icon> get a sane default size; specific
 * containers (nav, .ico, …) override it. */
[data-icon] { display: inline-flex; align-items: center; }
[data-icon] svg { width: 18px; height: 18px; }
.btn [data-icon] svg { width: 17px; height: 17px; }

h1, h2, h3 { font-family: var(--font-display); margin: 0; }

/* ---------- App shell: sidebar + main ---------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 210px;
  flex: 0 0 210px;
  background: linear-gradient(180deg, var(--side-top), var(--side-bottom));
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 22px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: #fff;
  color: var(--brand-deep);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.2px;
}

.side-section {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  padding: 4px 12px 10px;
}

.nav { display: flex; flex-direction: column; gap: 4px; }

.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  color: rgba(255, 255, 255, 0.82);
  padding: 10px 12px;
  border-radius: 11px;
  font-weight: 500;
  font-size: 14.5px;
  text-decoration: none;
}

.nav a svg { width: 19px; height: 19px; flex: 0 0 19px; opacity: 0.9; }

.nav a:hover { background: rgba(255, 255, 255, 0.07); text-decoration: none; }

.nav a.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(124, 92, 252, 0.65);
}

.nav .nav-sep {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin: 12px 12px;
}

.sidebar .side-foot,
.front-side .side-foot {
  margin-top: auto;
  padding: 14px 12px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.side-dots { display: grid; grid-template-columns: repeat(3, 7px); gap: 5px; }
.side-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.55); }

.side-foot .foot-name { font-weight: 700; font-size: 14.5px; }
.side-foot .foot-sub { font-size: 12.5px; color: rgba(255, 255, 255, 0.55); margin-top: -10px; }

.main { flex: 1; min-width: 0; padding: 28px 22px 56px; }

.main-inner { max-width: 1160px; margin: 0 auto; }

/* ---------- Topbar ---------- */

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.page-title h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.3px; }
.page-title .subtitle { color: var(--ink-2); margin-top: 6px; font-size: 15px; }

.crumbs { font-size: 13.5px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--brand); font-weight: 600; }
.crumbs .sep { margin: 0 8px; color: var(--line-2); }

.top-actions { display: flex; align-items: center; gap: 14px; }

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  cursor: pointer;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px 5px 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  position: relative;
}

.user-chip .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-strong);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
}

.user-chip svg { width: 14px; height: 14px; color: var(--muted); }

.user-chip .role-badge {
  background: var(--brand-soft);
  color: var(--brand-strong);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  min-width: 210px;
  padding: 6px;
  display: none;
  z-index: 60;
}

.user-menu.open { display: block; }

.user-menu button, .user-menu a {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
}

.user-menu button:hover, .user-menu a:hover { background: var(--brand-softer); text-decoration: none; }
.user-menu .menu-note { font-size: 12px; color: var(--muted); padding: 8px 12px 4px; }

.company-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 13px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink-2);
}

.company-pill svg { width: 16px; height: 16px; color: var(--ink-2); }
.company-pill.plain { background: none; border: 0; padding: 0; }

/* ---------- Cards & KPI ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 20px 16px 18px;
  text-align: center;
}

.kpi .ico {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
}

.kpi .ico svg { width: 24px; height: 24px; }

.ico.purple { background: var(--brand-soft); color: var(--brand-strong); }
.ico.orange { background: var(--orange); color: #fff; }
.ico.orange-soft { background: var(--orange-bg); color: var(--orange); }
.ico.green { background: #d9f2e4; color: #0e9f5d; }
.ico.red-soft { background: var(--red-bg); color: var(--red); }

.kpi .kpi-label { color: var(--ink-2); font-size: 13.5px; font-weight: 500; }
.kpi .kpi-value { font-family: var(--font-display); font-weight: 800; font-size: 27px; margin-top: 4px; letter-spacing: -0.3px; }
.kpi .kpi-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* Stat tiles (period section) */

.stat-tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-align: center;
}

.stat-tile .ico { width: 46px; height: 46px; margin-bottom: 10px; border-radius: 50%; display: grid; place-items: center; margin-left: auto; margin-right: auto; }
.stat-tile .label { color: var(--ink-2); font-size: 12.5px; font-weight: 500; min-height: 34px; display: flex; align-items: center; justify-content: center; }
.stat-tile .value { font-family: var(--font-display); font-weight: 800; font-size: 22px; margin-top: 2px; }
.stat-tile .delta { margin-top: 6px; font-size: 12.5px; font-weight: 700; color: var(--green); }
.stat-tile .delta.down { color: var(--red); }
.stat-tile .delta-sub { color: var(--muted); font-size: 11px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14.5px;
  padding: 10px 18px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 18px -8px rgba(124, 92, 252, 0.7);
}

.btn-primary:hover { background: var(--brand-strong); }

.btn-outline {
  background: #fff;
  border-color: var(--line-2);
  color: var(--ink-2);
}

.btn-outline:hover { border-color: var(--brand); color: var(--brand); }

.btn-ghost { background: none; color: var(--ink-2); }
.btn-sm { padding: 6px 10px; font-size: 12.5px; border-radius: 9px; }
.btn-lg { padding: 14px 22px; font-size: 16px; border-radius: 13px; }
.btn-block { width: 100%; }

.btn[disabled] { opacity: 0.55; cursor: not-allowed; box-shadow: none; }

/* ---------- Pills & badges ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 11px;
  white-space: nowrap;
}

.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.pill-green { background: var(--green-bg); color: #0d9a5f; }
.pill-orange { background: var(--orange-bg); color: #d97b06; }
.pill-red { background: var(--red-bg); color: var(--red); }
.pill-purple { background: var(--brand-soft); color: var(--brand-strong); }
.pill-gray { background: #f0eef6; color: var(--ink-2); }

.day-badge {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  padding: 4px 8px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 13px;
}

.day-badge.ok { background: var(--green-bg); color: #0d9a5f; }
.day-badge.warn { background: var(--orange-bg); color: #d97b06; }
.day-badge.danger { background: var(--red-bg); color: var(--red); }

.days-text { font-weight: 600; }
.days-text.ok { color: #0d9a5f; }
.days-text.warn { color: var(--orange); }
.days-text.danger { color: var(--red); }

/* ---------- Tabs ---------- */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding: 4px 8px 0;
  overflow-x: auto;
}

.tabs button {
  background: none;
  border: 0;
  border-bottom: 2.5px solid transparent;
  padding: 13px 16px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
}

.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.tabs button:hover { color: var(--brand-strong); }

/* Summary chips under tabs */

.summary-cards { display: flex; gap: 14px; flex-wrap: wrap; margin: 18px 0; }

.summary-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  padding: 14px 22px 14px 14px;
  min-width: 165px;
}

.summary-card .ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; }
.summary-card .ico svg { width: 20px; height: 20px; }
.summary-card .num { font-family: var(--font-display); font-weight: 800; font-size: 20px; line-height: 1.1; }
.summary-card .lbl { color: var(--ink-2); font-size: 12.5px; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data th {
  text-align: left;
  color: var(--ink);
  font-weight: 700;
  font-size: 12px;
  padding: 13px 7px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.data td {
  padding: 14px 7px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}

table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: var(--brand-softer); }

.cell-main { font-weight: 700; }
.cell-sub { color: var(--muted); font-size: 12px; margin-top: 1px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }

.co-cell { display: flex; align-items: center; gap: 11px; }

.co-ava {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  display: grid;
  place-items: center;
  flex: 0 0 34px;
}

.co-ava svg { width: 17px; height: 17px; }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  color: var(--muted);
  font-size: 13.5px;
}

.pager { display: flex; gap: 6px; align-items: center; }

.pager button {
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--ink-2);
  font-weight: 600;
  cursor: pointer;
}

.pager button.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-strong); }
.pager button[disabled] { opacity: 0.4; cursor: default; }

/* ---------- Section heads ---------- */

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
}

.section-head h2 { font-size: 18px; font-weight: 700; }
.section-head .see-all { font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }

.select-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-2);
  background: #fff;
  border-radius: 10px;
  padding: 8px 13px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
}

.select-pill svg { width: 15px; height: 15px; }

/* ---------- Alert list (Krever handling) ---------- */

.alert-list { display: flex; flex-direction: column; gap: 10px; padding: 0 20px 20px; }

.alert-row {
  display: flex;
  align-items: center;
  gap: 13px;
  border-radius: 12px;
  padding: 13px 16px;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid transparent;
}

.alert-row:hover { text-decoration: none; filter: brightness(0.985); }

.alert-row .chev { margin-left: auto; color: var(--muted); }
.alert-row svg { width: 19px; height: 19px; flex: 0 0 19px; }

.alert-warn { background: #fdf3e4; border-color: #f7e3c2; }
.alert-warn svg:first-child { color: var(--orange); }
.alert-soft { background: #f6f3fd; border-color: #e9e1fb; }
.alert-soft svg:first-child { color: var(--brand); }

/* ---------- Chart ---------- */

.chart-grid {
  display: grid;
  grid-template-columns: minmax(300px, 5fr) minmax(380px, 7fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 18px;
}

.chart-card { padding: 18px 20px; }

.chart-legend { display: flex; gap: 18px; font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend i { width: 9px; height: 9px; border-radius: 50%; }

.mini-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }

svg.chart text { font-family: var(--font-body); }

/* ---------- Login (front page) ---------- */

.front-shell { display: flex; min-height: 100vh; }

.front-side {
  width: 160px;
  flex: 0 0 160px;
  background: linear-gradient(180deg, var(--side-top), var(--side-bottom));
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 24px 14px 20px;
}

.front-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(480px, 700px) 300px;
  gap: 40px;
  justify-content: center;
  align-items: start;
  padding: 48px 44px;
}

.front-card { padding: 44px 44px 30px; text-align: center; }

.front-card .wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 54px;
  letter-spacing: -1px;
  color: var(--brand-deep);
}

.front-card .rule { width: 64px; height: 3px; border-radius: 3px; background: var(--brand); opacity: 0.5; margin: 16px auto 18px; }
.front-card h1 { font-size: 30px; font-weight: 800; }
.front-card .lede { color: var(--ink-2); margin-top: 6px; }

.front-company {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  border-radius: 11px;
  padding: 10px 18px;
  font-weight: 700;
  margin-top: 18px;
}

.front-company svg { width: 17px; height: 17px; }

/* The login module (auth.js) — Profrakt-portal-style sign-in: Google,
 * e-post + engangskode, passord as the alternative. The card keeps the
 * front-card frame; the form column is capped so it reads as a login. */

.login-card > .g-btn,
.login-card > .login-step,
.login-card > .login-divider,
.login-card > .login-alert-zone,
.login-card > .demo-accounts { max-width: 430px; margin-left: auto; margin-right: auto; }

.login-alert-zone:not(:empty) { margin-top: 18px; }

.login-alert {
  background: var(--red-bg);
  color: #b42318;
  border: 1px solid #f6c6c0;
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
}

.g-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line-2);
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  padding: 12px 18px;
  border-radius: 13px;
  margin-top: 24px;
}

.g-btn:hover { border-color: var(--brand); background: var(--brand-softer); }
.g-btn svg { width: 19px; height: 19px; flex: 0 0 19px; }

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  margin: 18px auto;
}

.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }

.login-step { text-align: left; }
.login-step[hidden] { display: none; }

.login-field { margin-bottom: 14px; }
.login-field label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.login-field input { width: 100%; }

.login-card .field-error { margin: -8px 0 12px; font-size: 12.5px; }

.kode-input { text-align: center; font-size: 22px; letter-spacing: 10px; font-weight: 700; }

.login-sent { color: var(--ink-2); font-size: 14px; margin: 0 0 12px; }

.demo-note {
  background: var(--orange-bg);
  border: 1px dashed #f2c286;
  color: #7a4b06;
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 13px;
  margin-bottom: 14px;
}

.demo-note b { font-size: 15px; letter-spacing: 2px; }

.login-alt { text-align: center; font-size: 13.5px; margin: 14px 0 0; }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 62px; }

.pw-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  color: var(--brand);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
}

.demo-accounts {
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: #fdfcff;
  padding: 14px 16px;
  margin-top: 26px;
  text-align: left;
}

.demo-accounts .da-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  margin-bottom: 8px;
}

.da-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }

.da-row .da-ava {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-strong);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex: 0 0 30px;
}

.da-row .da-who { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.da-row .da-who b { font-size: 13.5px; }
.da-row .da-who span { font-size: 12.5px; color: var(--muted); }

.da-foot { font-size: 12px; color: var(--muted); margin-top: 8px; }
.da-foot code { background: var(--brand-soft); border-radius: 5px; padding: 1px 6px; color: var(--brand-deep); font-size: 11.5px; }

/* Simulated Google account chooser */

.g-modal { width: min(400px, 100%); padding: 0; text-align: center; }

.g-head { padding: 26px 26px 8px; }
.g-head .g-logo { width: 34px; height: 34px; }
.g-head h3 { margin-top: 10px; }
.g-head p { color: var(--ink-2); font-size: 14px; margin: 2px 0 10px; }

.g-list { padding: 6px 14px 10px; }

.g-account {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 11px 12px;
  cursor: pointer;
  text-align: left;
}

.g-account:hover { background: var(--brand-softer); }

.g-account .g-ava {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-strong);
  display: grid;
  place-items: center;
  font-weight: 700;
  flex: 0 0 34px;
}

.g-account .g-who { display: flex; flex-direction: column; line-height: 1.3; }
.g-account .g-name { font-weight: 600; font-size: 14.5px; }
.g-account .g-mail { font-size: 13px; color: var(--muted); }

.g-foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; padding: 12px 20px 16px; }

.front-help {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--ink-2);
  font-size: 14px;
  margin-top: 26px;
}

.front-help .q {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.6px solid var(--brand);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
}

.front-rail { padding-top: 24px; display: flex; flex-direction: column; gap: 16px; }
.front-rail h2 { font-size: 21px; font-weight: 800; }
.front-rail .rail-lede { color: var(--ink-2); font-size: 14.5px; margin-top: -8px; }

.rail-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  padding: 16px;
}

.rail-card .ico { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 52px; }
.rail-card .ico svg { width: 24px; height: 24px; }
.rail-card .t { font-weight: 700; font-size: 14px; }
.rail-card .v { font-family: var(--font-display); font-weight: 800; font-size: 24px; line-height: 1.15; }
.rail-card .s { color: var(--muted); font-size: 12px; }

.front-cube { margin-top: 12px; align-self: center; }

/* ---------- Forms ---------- */

.form-grid { display: grid; grid-template-columns: minmax(420px, 7fr) minmax(300px, 5fr); gap: 18px; align-items: start; }

.form-card { padding: 24px; }
.form-card h2 { font-size: 17px; font-weight: 700; margin-bottom: 18px; }

.field { display: grid; grid-template-columns: 170px 1fr; gap: 14px; align-items: center; margin-bottom: 15px; }
.field > label { font-weight: 600; font-size: 14px; color: var(--ink); }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; display: block; }

.input-wrap { position: relative; }

input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  outline: none;
}

input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.14); }

input::placeholder { color: #b3accb; }

.input-wrap .trail-ico { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }

.input-error { border-color: var(--red) !important; }
.field-error { grid-column: 2; color: var(--red); font-size: 12.5px; margin-top: -10px; margin-bottom: 12px; }

.phone-row { display: grid; grid-template-columns: 108px 1fr; gap: 10px; }

/* Toggles (add-on products) */

.prod-list { display: flex; flex-direction: column; }

.prod-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
}

.prod-row:last-child { border-bottom: 0; }
.prod-row .p-name { font-weight: 600; font-size: 14px; flex: 1; display: flex; align-items: center; gap: 7px; }
.prod-row .p-price { color: var(--ink-2); font-size: 13.5px; white-space: nowrap; }

.info-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.4px solid var(--muted);
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  cursor: help;
}

.switch { position: relative; width: 42px; height: 24px; flex: 0 0 42px; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; }

.switch .track {
  position: absolute;
  inset: 0;
  background: #e4dff1;
  border-radius: 999px;
  transition: background 0.15s ease;
  pointer-events: none;
}

.switch .track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(35, 26, 58, 0.25);
  transition: left 0.15s ease;
}

.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { left: 21px; }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.25); }

/* Info boxes */

.info-card { padding: 18px 20px; }
.info-card .i-head { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.info-card .i-head svg { width: 19px; height: 19px; color: var(--brand); }
.info-card p { color: var(--ink-2); font-size: 13.5px; margin: 8px 0 10px; }
.info-card a { font-weight: 600; font-size: 13.5px; }

.info-banner {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--brand-softer);
  border: 1px solid #e9e1fb;
  border-radius: 14px;
  padding: 16px 18px;
  margin-top: 18px;
}

.info-banner .ico { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: 0 0 40px; }
.info-banner .ico svg { width: 19px; height: 19px; }
.info-banner b { display: block; margin-bottom: 3px; }
.info-banner p { margin: 0; color: var(--ink-2); font-size: 13.5px; }

.form-foot {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 18px;
}

/* ---------- Big register CTA (seller home) ---------- */

.cta-register {
  width: 100%;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #8a6cff, #7c5cfc);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  padding: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 12px 26px -10px rgba(124, 92, 252, 0.75);
  margin: 4px 0 20px;
  text-decoration: none;
}

.cta-register:hover { background: var(--brand-strong); text-decoration: none; }

/* ---------- Modal, drawer, toast ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(29, 16, 46, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}

.overlay.open { display: flex; }

.modal {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 70px -20px rgba(29, 16, 46, 0.5);
  width: min(560px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 26px 28px;
}

.modal h3 { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.modal .m-sub { color: var(--ink-2); font-size: 14px; margin-bottom: 16px; }

.modal .m-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.detail-rows { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 8px; }
.detail-rows .dr { display: flex; justify-content: space-between; gap: 14px; padding: 11px 15px; border-bottom: 1px solid var(--line); font-size: 14px; }
.detail-rows .dr:last-child { border-bottom: 0; }
.detail-rows .dr b { font-weight: 600; color: var(--ink-2); }
.detail-rows .dr span { font-weight: 600; text-align: right; }

.toast-zone { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px; z-index: 200; }

.toast {
  background: var(--brand-deep);
  color: #fff;
  border-radius: 12px;
  padding: 13px 20px;
  font-weight: 600;
  font-size: 14.5px;
  box-shadow: 0 16px 34px -12px rgba(29, 16, 46, 0.6);
  display: flex;
  gap: 10px;
  align-items: center;
  animation: toast-in 0.22s ease;
}

.toast svg { width: 20px; height: 20px; flex: 0 0 20px; }
.toast.ok svg { color: #4ade80; }
.toast.warn svg { color: #fbbf24; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Knowledge base / misc grids ---------- */

.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }

.kb-card { padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.kb-card .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-strong); display: grid; place-items: center; }
.kb-card .ico svg { width: 20px; height: 20px; }
.kb-card h3 { font-size: 15.5px; font-weight: 700; }
.kb-card p { color: var(--ink-2); font-size: 13.5px; margin: 0; flex: 1; }
.kb-card .kb-link { font-weight: 600; font-size: 13.5px; }

.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }

.price-card { padding: 24px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.price-card .p-badge { position: absolute; top: 16px; right: 16px; }
.price-card h3 { font-size: 16.5px; font-weight: 800; }
.price-card .p-desc { color: var(--ink-2); font-size: 13.5px; min-height: 40px; }
.price-card .p-num { font-family: var(--font-display); font-weight: 800; font-size: 26px; }
.price-card .p-num small { font-size: 13px; color: var(--muted); font-weight: 600; }
.price-card ul { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.price-card li { display: flex; gap: 9px; font-size: 13.5px; color: var(--ink-2); align-items: center; }
.price-card li svg { width: 15px; height: 15px; color: var(--green); flex: 0 0 15px; }

/* ---------- Filters row ---------- */

.filter-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }

.chip {
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--ink-2);
  border-radius: 999px;
  padding: 7px 15px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.chip.active { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }

.search-wrap { position: relative; margin-left: auto; }
.search-wrap input { width: 240px; padding-left: 38px; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }

/* ---------- Empty state ---------- */

.empty {
  text-align: center;
  padding: 46px 20px;
  color: var(--ink-2);
}

.empty .e-ico { width: 64px; height: 64px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 14px; }
.empty b { display: block; font-size: 16px; color: var(--ink); margin-bottom: 4px; }

/* ---------- Responsive ---------- */


/* ---------- Notification bell ------------------------------------------- */

.bell-wrap { position: relative; }
.bell-wrap .icon-btn { position: relative; }
.bell-dot {
  position: absolute; top: 7px; right: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--orange); border: 2px solid #fff;
}
.bell-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 320px; max-width: calc(100vw - 32px);
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(35, 26, 58, .14);
  padding: 6px; z-index: 40; display: none;
}
.bell-menu.open { display: block; }
.bell-head {
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); padding: 8px 10px 6px;
}
.bell-row {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 9px 10px; border-radius: 8px;
  font-size: 13.5px; color: var(--ink); text-decoration: none; line-height: 1.35;
}
.bell-row:hover { background: var(--brand-soft); }
.bell-ico { flex: 0 0 auto; width: 17px; height: 17px; margin-top: 1px; }
.bell-ico svg { width: 17px; height: 17px; }
.bell-row.danger .bell-ico { color: var(--red, #d92d20); }
.bell-row.warn .bell-ico { color: var(--orange); }
.bell-empty { padding: 6px 10px 12px; font-size: 13.5px; color: var(--muted); }

/* ---------- Month / window pickers -------------------------------------- */

.pick-wrap { position: relative; display: inline-block; }
.pick-menu {
  position: absolute; left: 0; top: calc(100% + 6px);
  min-width: 190px; max-height: 320px; overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(35, 26, 58, .14);
  padding: 5px; z-index: 40; display: none;
}
.pick-menu.open { display: block; }
.pick-menu button {
  display: flex; width: 100%; justify-content: space-between; align-items: center;
  gap: 10px; padding: 8px 10px; border: 0; background: none; border-radius: 7px;
  font: inherit; font-size: 13.5px; color: var(--ink); text-align: left; cursor: pointer;
}
.pick-menu button:hover { background: var(--brand-soft); }
.pick-menu button.active { background: var(--brand-soft); font-weight: 600; }
.pick-none { font-size: 11.5px; color: var(--muted); }
.select-pill .p-ico { display: inline-flex; width: 15px; height: 15px; }
.select-pill .p-ico svg { width: 15px; height: 15px; }

/* ---------- Partner label ------------------------------------------------ */

.company-pill.static {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px; border: 1px solid var(--line); border-radius: 99px;
  background: #fff; font-weight: 600; font-size: 14px; color: var(--ink);
}
.company-pill.static svg { width: 16px; height: 16px; color: var(--brand-strong); }
.pill-count {
  font-size: 11.5px; font-weight: 700; color: var(--brand-strong);
  background: var(--brand-soft); border-radius: 99px; padding: 1px 7px;
}
.pill-list {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  margin-top: 7px; font-size: 12.5px; color: var(--muted);
}

/* ---------- Lead detail: products --------------------------------------- */

.prod-chip {
  display: inline-block; margin: 0 4px 4px 0; padding: 2px 9px;
  border-radius: 99px; background: var(--brand-soft); color: var(--brand-strong);
  font-size: 12px; font-weight: 600;
}

/* ---------- Settlement --------------------------------------------------- */

.settle-head { margin-bottom: 16px; }
.settle-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px; margin-bottom: 18px;
}
.settle-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px;
}
.settle-card.strong { border-color: var(--brand); background: var(--brand-soft); }
.settle-card .s-label {
  font-size: 12px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted);
}
.settle-card .s-value {
  font-family: Poppins, sans-serif; font-size: 24px; font-weight: 700;
  color: var(--ink); margin: 4px 0 2px;
}
.settle-card .s-hint { font-size: 12.5px; color: var(--muted); }
.section-note { font-size: 13px; color: var(--muted); }
.page-note { font-size: 13px; color: var(--muted); max-width: 70ch; margin-top: 16px; }

/* ---------- Knowledge base ----------------------------------------------- */

.kb-card { display: flex; flex-direction: column; gap: 8px; }
.kb-ico { width: 34px; height: 34px; color: var(--brand-strong); }
.kb-ico svg { width: 22px; height: 22px; }
.kb-soon {
  align-self: flex-start; margin-top: auto; padding: 3px 10px; border-radius: 99px;
  background: #f0eef6; color: var(--muted); font-size: 12px; font-weight: 600;
}
.kb-back {
  display: inline-block; margin-bottom: 6px;
  font-size: 13px; font-weight: 600; color: var(--brand-strong); text-decoration: none;
}
.kb-back:hover { text-decoration: underline; }

.article { max-width: 760px; padding: 30px 34px 34px; line-height: 1.62; }
.article h2 {
  font-family: Poppins, sans-serif; font-size: 17px; font-weight: 600;
  margin: 26px 0 8px; color: var(--ink);
}
.article p { margin: 0 0 12px; color: #3f3856; }
.article ul, .article ol { margin: 0 0 14px; padding-left: 20px; color: #3f3856; }
.article li { margin-bottom: 7px; }
.article .lead-in { font-size: 16.5px; color: var(--ink); }
.article a { color: var(--brand-strong); }
.article-table-wrap { overflow-x: auto; margin: 0 0 16px; }
.article-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.article-table th, .article-table td {
  text-align: left; padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: top;
}
.article-table thead th {
  border-top: 0; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); background: #faf9fc;
}
.article-note {
  margin-top: 24px; padding: 14px 18px; border-radius: 10px;
  background: var(--brand-soft); color: #372c5c; font-size: 14px;
}
.steps { list-style: none; padding: 0; counter-reset: step; }
.steps > li { counter-increment: step; position: relative; padding-left: 44px; margin-bottom: 22px; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 2px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-strong);
  font-family: Poppins, sans-serif; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.steps > li h2 { margin: 0 0 6px; }
.step-why { font-size: 13.5px; color: var(--muted); }

/* ---------- Form additions ----------------------------------------------- */

.field-hint { font-size: 12.5px; color: var(--muted); margin: -4px 0 12px; }
.field-hint.ok { color: var(--green, #0e9f5d); }
.field-hint.bad { color: var(--red, #d92d20); }
.opt { font-size: 12px; font-weight: 500; color: var(--muted); }
.form-card textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  font: inherit; font-size: 14px; color: var(--ink); resize: vertical; background: #fff;
}
.form-card textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }

@media (max-width: 1100px) {
  .chart-grid, .form-grid { grid-template-columns: 1fr; }
  .front-main { grid-template-columns: 1fr; padding: 32px 24px; }
  .front-rail { max-width: 520px; }
}

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { position: static; width: 100%; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 12px 14px; overflow-x: auto; }
  .sidebar .brand { padding: 0 10px 0 0; }
  .brand-name, .side-section, .side-foot { display: none; }
  .nav { flex-direction: row; }
  .nav a { padding: 9px 11px; }
  .nav a span { display: none; }
  .nav .nav-sep { display: none; }
  .main { padding: 20px 16px 48px; }
  .front-shell { flex-direction: column; }
  .front-side { width: 100%; flex-direction: row; padding: 12px 16px; }
  .front-side .side-foot, .front-side .side-section { display: none; }
  .field { grid-template-columns: 1fr; gap: 6px; }
  .field-error { grid-column: 1; }
  .front-card { padding: 28px 20px; }
  .page-title h1 { font-size: 26px; }
  /* The nine-column lead table cannot shrink to a phone. It scrolls inside
     its own card instead, so the PAGE never scrolls sideways. */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { min-width: 720px; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .mini-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .settle-cards { grid-template-columns: repeat(2, 1fr); }
  .kb-grid { grid-template-columns: 1fr; }
  .article { padding: 22px 18px 26px; }
  .bell-menu { width: calc(100vw - 32px); }
}

@media (max-width: 520px) {
  .kpi-row, .mini-stat-grid, .settle-cards { grid-template-columns: 1fr; }
  .main { padding: 16px 12px 40px; }
  /* A modal that cannot scroll is a modal whose buttons are unreachable. */
  .modal { max-height: 86vh; overflow-y: auto; }
  .m-foot { flex-wrap: wrap; }
  .m-foot .btn { flex: 1 1 auto; }
  .row-actions { flex-wrap: wrap; }
  .user-chip span:not(.avatar):not(.role-badge) { display: none; }
  .topbar { flex-wrap: wrap; gap: 12px; }
}
