.portal-body,
.login-body {
  --font: "Inter", "Segoe UI", sans-serif;
  --display: "Inter", "Segoe UI", sans-serif;
}

.portal-body {
  background: var(--paper);
  min-height: 100vh;
}

.portal-body [hidden] {
  display: none !important;
}

.portal-nav {
  gap: 0.8rem;
}

.portal-nav span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.88rem;
}

.portal-login {
  max-width: 420px;
}

.portal-app {
  padding-top: 1.6rem;
}

.portal-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.portal-stats-six {
  grid-template-columns: repeat(3, 1fr);
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 5px solid var(--sky);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: 0 6px 18px rgba(7, 18, 40, 0.05);
}

.stat-card strong {
  display: block;
  font-family: var(--display);
  font-size: 1.35rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.accent-sky {
  border-left-color: var(--sky);
  background: linear-gradient(100deg, var(--sky-soft), var(--white) 62%);
}

.accent-light {
  border-left-color: var(--sky-light);
  background: linear-gradient(100deg, var(--sky-soft), var(--white) 62%);
}

.accent-deep {
  border-left-color: var(--sky-deep);
  background: linear-gradient(100deg, var(--sky-soft-2), var(--white) 62%);
}

.accent-navy {
  border-left-color: var(--navy);
  background: linear-gradient(100deg, var(--sky-soft-3), var(--white) 62%);
}

.accent-warn {
  border-left-color: var(--warn);
  background: linear-gradient(100deg, var(--warn-soft), var(--white) 62%);
}

.portal-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.form-preview-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 9rem);
  min-height: 40rem;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.portal-tabs {
  display: flex;
  gap: 0.4rem;
}

.tab-btn {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  font: inherit;
  cursor: pointer;
}

.tab-btn.is-active {
  background: linear-gradient(120deg, var(--navy), var(--sky-deep));
  color: var(--white);
  border-color: var(--navy);
}

.tab-btn.tab-admin {
  border-color: rgba(22, 131, 199, 0.5);
  color: var(--sky-2);
  font-weight: 700;
}

.tab-btn.tab-admin.is-active {
  background: linear-gradient(120deg, var(--sky-deep), var(--sky));
  border-color: var(--sky-deep);
  color: var(--white);
}

.table-wrap {
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
}

.leads-table th,
.leads-table td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}

.leads-table tbody tr {
  cursor: pointer;
}

.leads-table tbody tr:hover {
  background: var(--sky-soft);
}

.pill {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--sky-soft);
  color: var(--sky-2);
}

/* Stages run through the Blue Sky blues as a lead progresses, then land on
   green for won and red for lost. */
.stage-new { background: var(--sky-soft); color: var(--sky-2); }
.stage-qualified { background: var(--sky-soft-2); color: var(--sky-2); }
.stage-opportunity { background: var(--sky-soft-3); color: var(--sky-deep); }
.stage-quote { background: var(--sky-light); color: #04283f; }
.stage-won { background: var(--ok-soft); color: var(--ok); }
.stage-lost { background: var(--stop-soft); color: var(--stop); }

.status-draft { background: var(--sky-soft); color: var(--sky-2); }
.status-sent { background: var(--sky-soft-3); color: var(--sky-deep); }
.status-accepted { background: var(--ok-soft); color: var(--ok); }
.status-declined { background: var(--stop-soft); color: var(--stop); }

.role-pill {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.role-super { background: var(--navy); color: var(--white); }
.role-admin { background: var(--sky); color: var(--white); }
.role-sales { background: var(--sky-light); color: #04283f; }
.role-finance { background: var(--ok); color: var(--white); }

.board {
  display: grid;
  grid-template-columns: repeat(6, minmax(160px, 1fr));
  gap: 0.75rem;
  overflow-x: auto;
}

.column {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 4px solid var(--sky);
  border-radius: 12px;
  padding: 0.7rem;
  min-height: 12rem;
}

.column-new { border-top-color: var(--sky-light); }
.column-qualified { border-top-color: var(--sky-mid); }
.column-opportunity { border-top-color: var(--sky); }
.column-quote { border-top-color: var(--sky-deep); }
.column-won { border-top-color: var(--ok); }
.column-lost { border-top-color: var(--stop); }

.column h2 {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 0.6rem;
  display: flex;
  justify-content: space-between;
}

.card-mini {
  display: grid;
  gap: 0.15rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 10px;
  padding: 0.7rem;
  margin-bottom: 0.5rem;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.card-mini span {
  color: var(--muted);
  font-size: 0.86rem;
}

.card-mini {
  cursor: default;
}

.card-lead,
.card-quotes a,
.card-create {
  color: inherit;
  text-decoration: none;
}

.card-lead {
  display: grid;
  gap: 0.15rem;
}

.card-lead:hover strong,
.card-quotes a:hover strong,
.card-create:hover {
  color: var(--sky);
}

.card-quotes {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
}

.card-quotes a {
  display: grid;
  gap: 0.05rem;
}

.card-quotes strong {
  font-size: 0.82rem;
}

.card-create {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.drawer {
  position: fixed;
  inset: 0;
  background: rgba(7, 11, 20, 0.45);
  z-index: 50;
  display: grid;
  justify-items: end;
}

.drawer[hidden] {
  display: none;
}

.drawer-panel {
  width: min(540px, 100%);
  height: 100%;
  background: var(--white);
  padding: 1.4rem 1.3rem 2rem;
  overflow: auto;
  position: relative;
}

.drawer-close {
  position: absolute;
  top: 0.7rem;
  right: 0.8rem;
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  cursor: pointer;
}

.lead-message {
  background: var(--paper);
  padding: 0.8rem 0.9rem;
  border-radius: 10px;
}

.notes {
  list-style: none;
  padding: 0;
  margin: 0;
}

.notes li {
  border-top: 1px solid var(--line);
  padding: 0.7rem 0;
}

.notes time {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.form-error {
  margin: 0;
  background: var(--stop-soft);
  color: var(--stop);
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
}

.agent-box {
  background: var(--sky-soft);
  border-radius: 12px;
  padding: 0.9rem 1rem 1rem;
  margin: 0.9rem 0 1.1rem;
}

.agent-box .kicker {
  margin-bottom: 0.35rem;
}

.agent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.lead-list {
  display: grid;
  gap: 0.85rem;
}

.lead-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 5px solid var(--sky);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  cursor: pointer;
}

.lead-card:hover {
  box-shadow: 0 10px 26px rgba(7, 18, 40, 0.09);
}

.stage-edge-new { border-left-color: var(--sky-light); }
.stage-edge-qualified { border-left-color: var(--sky-mid); }
.stage-edge-opportunity { border-left-color: var(--sky); }
.stage-edge-quote { border-left-color: var(--sky-deep); }
.stage-edge-won { border-left-color: var(--ok); }
.stage-edge-lost { border-left-color: var(--stop); }

.lead-card h3 {
  margin: 0 0 0.2rem;
  font-family: var(--display);
  font-size: 1.1rem;
}

.lead-card p {
  margin: 0.15rem 0;
  color: var(--muted);
}

.row-agent {
  flex-shrink: 0;
}

.drawer-panel .form {
  border: 0;
  padding: 0;
  box-shadow: none;
}

/* ---------------------------------------------------------- inventory */

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem;
}

.inv-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 4px solid var(--sky);
  border-radius: var(--radius);
  padding: 0.95rem 1rem 1rem;
  cursor: pointer;
}

.inv-card:hover {
  box-shadow: 0 10px 26px rgba(7, 18, 40, 0.09);
}

.inv-card h3 {
  margin: 0.35rem 0 0.2rem;
  font-family: var(--display);
  font-size: 1rem;
  line-height: 1.3;
}

.cat-chip {
  display: inline-block;
  margin: 0;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  background: var(--sky-soft);
  color: var(--sky-2);
}

/* Categories are told apart by depth of the same brand blue, not by hue. */
.cat-satellite { border-top-color: var(--sky); }
.cat-wireless { border-top-color: var(--sky-light); }
.cat-wireless .cat-chip { background: var(--sky-soft); color: var(--sky-2); }
.cat-fibre { border-top-color: var(--sky-mid); }
.cat-fibre .cat-chip { background: var(--sky-soft-2); color: var(--sky-2); }
.cat-power { border-top-color: var(--sky-deep); }
.cat-power .cat-chip { background: var(--sky-soft-3); color: var(--sky-deep); }
.cat-cctv { border-top-color: var(--navy); }
.cat-cctv .cat-chip { background: var(--sky-soft-3); color: var(--navy); }
.cat-service { border-top-color: var(--ok); }
.cat-service .cat-chip { background: var(--ok-soft); color: var(--ok); }

.sku {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
}

.price {
  margin: 0.5rem 0 0.15rem;
  font-family: var(--display);
  font-weight: 700;
}

.qty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.qty.is-low {
  color: var(--stop);
  font-weight: 700;
}

/* ------------------------------------------------------------- quotes */

.quote-sheet {
  background: #fff;
  border: 1px solid #e3e8f0;
  border-radius: 12px;
  padding: 1.15rem 1.25rem 1.05rem;
  margin-bottom: 1rem;
}

.quote-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.quote-sheet-head h2 {
  margin: 0.15rem 0 0.25rem;
  font-size: 1.25rem;
}

.quote-sheet-head p {
  margin: 0;
  color: #5c6b82;
}

.quote-meta {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  min-width: 11rem;
  text-align: right;
}

.quote-meta div {
  display: grid;
  gap: 0.05rem;
}

.quote-meta dt {
  color: #5c6b82;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.quote-meta dd {
  margin: 0;
  font-weight: 650;
}

.quote-lines {
  margin: 0;
}

.quote-lines .leads-table tbody tr,
.quote-lines .leads-table tbody tr:hover {
  cursor: default;
  background: transparent;
}

.quote-lines .leads-table td,
.quote-lines .leads-table th {
  padding: 0.65rem 0.75rem;
  font-size: 0.9rem;
}

.quote-lines th.num,
.quote-lines td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.quote-lines .line-action {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

.quote-sheet-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-top: 0.9rem;
}

.quote-terms {
  margin: 0;
  max-width: 36rem;
  color: #5c6b82;
  font-size: 0.9rem;
}

.quote-tools {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 1rem;
  align-items: start;
}

.quote-tools h2 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  font-weight: 650;
}

.quote-tools .settings-card,
.quote-tools .dash-panel {
  margin-bottom: 0;
}

.quote-tools .span-all {
  grid-column: 1 / -1;
}

.handoff-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
  list-style: none;
  padding: 0;
  margin: 0 0 0.9rem;
}

.handoff-steps li {
  background: #f4f7fb;
  border-radius: 10px;
  padding: 0.6rem 0.65rem;
  font-size: 0.8rem;
  line-height: 1.35;
}

.handoff-steps li.is-current {
  background: #121a2f;
  color: #fff;
  font-weight: 650;
}

.handoff-steps li.is-done {
  background: #e7f6ee;
  color: #146c43;
}

.quote-create {
  margin-bottom: 0;
}

.totals-box {
  background: #f4f7fb;
  border-radius: 12px;
  padding: 0.8rem 1rem;
  margin: 0;
  min-width: 16rem;
}

.totals-box p {
  display: flex;
  justify-content: space-between;
  margin: 0.2rem 0;
}

.totals-box .grand {
  border-top: 1px solid rgba(13, 79, 124, 0.28);
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  font-family: var(--display);
  font-size: 1.1rem;
}

/* -------------------------------------------------------------- admin */

.admin-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.6rem;
}

.row-disabled {
  opacity: 0.55;
}

.row-actions {
  white-space: nowrap;
}

.role-select {
  padding: 0.3rem 0.4rem;
  border-radius: 8px;
  font-size: 0.85rem;
}

.cred-box {
  background: var(--navy);
  color: var(--white);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin: 0.9rem 0 1rem;
}

.cred-box p {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.35rem 0;
  font-size: 0.92rem;
}

.cred-box span {
  color: rgba(255, 255, 255, 0.66);
}

.cred-box strong {
  font-family: var(--display);
  word-break: break-all;
  text-align: right;
}

/* ------------------------------------------------------- shared bits */

.notice {
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  margin: 0 0 1rem;
  font-weight: 600;
}

.notice-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.notice-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.notice-ok pre {
  white-space: pre-wrap;
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  margin: 0.4rem 0 0;
}

.link-btn {
  border: 0;
  background: none;
  padding: 0 0.35rem 0 0;
  font: inherit;
  font-weight: 700;
  color: var(--sky-2);
  cursor: pointer;
}

.link-btn.danger {
  color: var(--stop);
}

.btn-danger {
  background: var(--stop);
  color: var(--white);
}

.btn-danger:hover {
  background: #8f3a28;
  color: var(--white);
}

.two-up {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  font-size: 0.9rem;
}

.check input {
  width: auto;
}

.mini-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.mini-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-top: 1px solid var(--line);
  padding: 0.5rem 0;
  font-size: 0.92rem;
}

.form-success {
  display: none;
  background: var(--ok-soft);
  color: var(--ok);
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  margin: 0 0 1rem;
}

/* ------------------------------------------------- admin sign-in page */

.login-body [hidden] {
  display: none !important;
}

.login-top-title {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1c2434;
}

.login-body .app-top .theme-toggle {
  margin-left: auto;
}

.login-body.portal-body .portal-page .wrap {
  width: min(460px, calc(100% - 2.4rem));
  margin-inline: auto;
}

.login-body .page-head {
  justify-content: center;
  text-align: center;
  border-bottom: 0;
  padding-bottom: 0.2rem;
}

.login-stage {
  align-items: flex-start;
}

.login-card {
  padding: 1.45rem 1.4rem 1.25rem;
}

.login-card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.5rem;
}

.login-hint {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 1.1rem;
}

/* The card is the box, so the shared form styling should not draw a second one. */
.login-form {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.login-form .form-error {
  margin-bottom: 0.2rem;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  width: 100%;
  padding-right: 4.4rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  border: 0;
  background: var(--sky-soft);
  color: var(--sky-2);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
}

.password-toggle:hover {
  background: var(--sky-soft-2);
}

.login-submit {
  margin-top: 0.4rem;
  justify-content: center;
  text-align: center;
}

.login-server {
  margin: 1rem 0 0;
  background: var(--warn-soft);
  color: var(--warn);
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
}

.login-address {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0;
}

.login-address strong {
  color: var(--ink);
}

@media (max-width: 860px) {
  .login-body {
    grid-template-columns: 1fr;
  }

  .login-stage {
    align-items: flex-start;
  }
}

@media (max-width: 1100px) {
  .portal-stats-six,
  .stage-bar {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 860px) {
  .portal-stats,
  .portal-stats-six,
  .stage-bar,
  .admin-grid,
  .two-up,
  .dash-grid {
    grid-template-columns: 1fr 1fr;
  }

  .board,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .portal-tabs {
    flex-wrap: wrap;
  }

  .page-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .portal-stats,
  .portal-stats-six,
  .stage-bar,
  .dash-grid {
    grid-template-columns: 1fr;
  }
}

.portal-page {
  padding: 1.6rem 0 3.2rem;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.page-head h1 {
  margin: 0;
}

.page-head p {
  margin: 0 0 0.25rem;
}

.crumb {
  margin: 0 0 0.8rem;
  font-size: 0.92rem;
}

.crumb a {
  color: var(--sky-2);
  font-weight: 700;
  text-decoration: none;
}

.portal-account {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.account-link {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.88rem;
}

.portal-mainnav {
  background: rgba(7, 27, 47, 0.55);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.portal-mainnav .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.55rem 0 0.7rem;
}

.nav-tab {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 0.45rem 0.85rem;
  font-weight: 650;
  font-size: 0.92rem;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.nav-tab.is-active {
  background: linear-gradient(120deg, var(--sky), var(--sky-2));
  border-color: transparent;
  color: var(--white);
}

.nav-tab-admin {
  border-color: rgba(77, 180, 234, 0.45);
  color: var(--sky-light);
}

.nav-tab-admin.is-active {
  background: linear-gradient(120deg, var(--sky-deep), var(--sky));
}

a.stat-card {
  color: inherit;
  text-decoration: none;
}

a.stat-card:hover,
a.lead-card:hover,
a.inv-card:hover {
  box-shadow: 0 10px 24px rgba(7, 18, 40, 0.1);
}

a.lead-card,
a.inv-card {
  text-decoration: none;
  color: inherit;
  display: block;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.dash-hello {
  margin: 0 0 1rem;
}

.dash-hello p {
  margin: 0;
}

.dash-hello p:first-child {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;
}

.dash-alert {
  background: var(--sky-soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--sky);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin: 0 0 1rem;
}

.dash-alert-warn {
  background: var(--warn-soft);
  border-left-color: var(--warn);
}

.dash-alert strong {
  display: inline;
}

.stage-bar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.45rem;
  margin: 0 0 1.2rem;
}

.stage-bar-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-decoration: none;
  color: inherit;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
}

.stage-bar-item strong {
  font-family: var(--display);
  font-size: 1.15rem;
}

.stage-bar-item span {
  font-size: 0.78rem;
  color: var(--muted);
}

.stat-card.is-hot {
  box-shadow: 0 8px 22px rgba(22, 131, 199, 0.16);
}

.mini-list li.is-overdue a {
  color: var(--stop);
}

.dash-won {
  margin: 0.8rem 0 0;
}

.panel-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.mini-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.2rem;
  align-items: start;
}

.detail-main,
.detail-side {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
}

.detail-main h2,
.detail-side h2 {
  margin-top: 0;
}

.narrow-form {
  max-width: 520px;
}

.detail-side .form {
  background: none;
  border: 0;
  padding: 0;
}

.detail-side label {
  margin-bottom: 0.7rem;
}

.support-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(320px, 1.15fr);
  gap: 1.2rem;
  align-items: start;
}

.support-thread {
  max-height: 28rem;
  overflow: auto;
  display: grid;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.support-msg pre,
.support-result pre {
  white-space: pre-wrap;
  font: inherit;
  margin: 0.2rem 0 0;
}

.support-msg {
  background: var(--paper);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
}

.support-msg-assistant {
  background: #eef6fb;
  border: 1px solid var(--line);
}

.support-compose textarea {
  width: 100%;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.8rem 0;
}

.chip,
.chip-btn {
  display: inline-block;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font: inherit;
  font-size: 0.82rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.sev-p1 { background: #f4d2d0; color: #5c1210; }
.sev-p2 { background: #f7e3c4; color: #5c3b08; }
.sev-p3 { background: var(--sky-light); color: #04283f; }
.sev-sales { background: var(--navy); color: #fff; }
.sev-info { background: var(--paper); }

@media (max-width: 860px) {
  .support-grid {
    grid-template-columns: 1fr;
  }
}

/* Sidebar shell, matching the reference portal layout. */
.portal-body {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  grid-template-rows: 72px minmax(0, 1fr);
  min-height: 100vh;
  background:
    radial-gradient(1200px 480px at 100% -10%, rgba(77, 180, 234, 0.16), transparent 55%),
    #e7eef6;
  color: #17233a;
}

#chrome {
  display: contents;
}

.app-side {
  grid-column: 1;
  grid-row: 1 / -1;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(77, 180, 234, 0.14), transparent 180px),
    linear-gradient(180deg, #071422 0%, #0b2138 100%);
  color: #d5dbe8;
  padding: 1.2rem 0.85rem 1rem;
  overflow: auto;
  box-shadow: 8px 0 28px rgba(7, 20, 34, 0.18);
}

.side-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  margin: 0.15rem 0.45rem 1rem;
  color: #fff;
  text-decoration: none;
}

.side-brand img {
  width: 186px;
  height: auto;
  background: none;
  border-radius: 0;
  padding: 0;
}

.side-brand-text strong {
  display: none;
}

.side-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.side-brand-text strong {
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.side-brand-text small {
  margin-top: 0.15rem;
  color: #9aa6bd;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.side-nav {
  flex: 1 1 auto;
}

.side-label,
.side-sub summary {
  margin: 0.95rem 0.7rem 0.28rem;
  color: #8b97ad;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.side-sub {
  margin-top: 0.35rem;
}

.side-sub summary {
  cursor: pointer;
  list-style: none;
}

.side-sub summary::-webkit-details-marker {
  display: none;
}

.side-sub summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.35rem;
  color: #9aa6bd;
}

.side-sub[open] summary::before {
  content: "▾";
}

.side-sub-links {
  margin-left: 0.35rem;
}

.side-link {
  display: flex;
  align-items: center;
  margin: 0.16rem 0.2rem;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  color: #d7e2ef;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.94rem;
  letter-spacing: 0.01em;
}

.side-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.side-link.is-active {
  background: linear-gradient(90deg, rgba(22, 131, 199, 0.38), rgba(22, 131, 199, 0.1));
  box-shadow: inset 3px 0 0 #4db4ea;
  color: #fff;
  font-weight: 650;
}

.side-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.7rem 0.35rem 0.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.app-top {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0 1.5rem;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(11, 45, 74, 0.08);
  backdrop-filter: blur(16px);
}

.top-search {
  flex: 1 1 auto;
}

.top-search input {
  width: min(460px, 100%);
  border: 1px solid rgba(11, 45, 74, 0.12);
  background: #fff;
  border-radius: 999px;
  padding: 0.62rem 1.05rem 0.62rem 1.15rem;
  font: inherit;
  font-size: 0.92rem;
  color: #17233a;
  box-shadow: 0 1px 2px rgba(7, 27, 47, 0.04);
}

.top-search input:focus {
  outline: 2px solid rgba(22, 131, 199, 0.35);
  border-color: #1683c7;
}

.top-coverage {
  flex: 0 0 auto;
  background: #2f6fed;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
}

.top-account {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #1c2434;
  text-decoration: none;
  min-width: 0;
}

.top-name {
  display: block;
  font-weight: 700;
  font-size: 0.86rem;
}

.top-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1f8f4e;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  flex: 0 0 auto;
}

.top-signout {
  border: 0;
  background: transparent;
  color: #c5cedd;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
}

.portal-body .portal-page {
  grid-column: 2;
  grid-row: 2;
  padding: 1.55rem 0 3rem;
  background: transparent;
}

.portal-body .portal-page .wrap {
  width: min(1240px, calc(100% - 3rem));
}

.portal-body.portal-map-page {
  height: 100vh;
}

.portal-body.portal-map-page .portal-page {
  padding: 0;
  min-height: 0;
  display: flex;
  background: #e8eef4;
}

.portal-body.portal-map-page .portal-map-frame {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #e8eef4;
}

.portal-body .page-head {
  align-items: center;
  margin-bottom: 0.85rem;
}

.portal-body .page-head h1 {
  font-family: var(--font);
  font-size: 1.85rem;
  font-weight: 650;
  letter-spacing: -0.035em;
  color: #102033;
}

.portal-body .page-head .agent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.isp-date {
  margin: -0.35rem 0 0.75rem;
  color: #7d786e;
  font-size: 0.88rem;
}

.isp-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.isp-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 92px;
  padding: 0.95rem 1.15rem;
  background: #fff;
  border: 1px solid #e5e0d6;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}

.isp-metric-title {
  display: block;
  font-weight: 650;
  color: #3a3a3a;
}

.isp-view {
  display: inline-block;
  margin-top: 0.2rem;
  color: #3b5ccc;
  font-size: 0.92rem;
  font-weight: 650;
}

.isp-metric strong {
  font-family: var(--font);
  font-size: 1.45rem;
  font-weight: 650;
  color: #3d4f86;
}

.isp-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.isp-action {
  display: block;
  background: #fff;
  border: 1px solid #e5eaf2;
  border-radius: 10px;
  padding: 0.9rem 1rem;
  text-decoration: none;
  color: inherit;
}

.isp-action strong {
  display: block;
  margin-bottom: 0.25rem;
}

.isp-action span {
  color: #5c6b82;
  font-size: 0.9rem;
}

.isp-card {
  background: #fff;
  border: 1px solid #e5e0d6;
  border-radius: 8px;
  padding: 0.85rem 1rem 1rem;
  margin-bottom: 0.85rem;
}

.isp-card-head h2,
.isp-card h2 {
  margin: 0 0 0.7rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 650;
  color: #3a3a3a;
}

.isp-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.1rem;
}

.isp-shortcuts a {
  color: #3b5ccc;
  font-weight: 650;
  text-decoration: none;
}

.isp-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.isp-split .isp-card {
  margin-bottom: 0.85rem;
}

.isp-rows {
  margin: 0;
}

.isp-rows div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.42rem 0;
  border-bottom: 1px solid #f0ece4;
}

.isp-rows dt {
  color: #4a4a4a;
}

.isp-rows dd {
  margin: 0;
  font-weight: 700;
  color: #2f2f2f;
}

.portal-body .dash-grid {
  gap: 0.85rem;
}

.portal-body .panel-card {
  background: #fff;
  border: 1px solid #e5e0d6;
  border-radius: 8px;
  box-shadow: none;
}

.portal-body .stage-bar {
  gap: 0.45rem;
}

@media (max-width: 860px) {
  .portal-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .app-side,
  .app-top,
  .portal-body .portal-page {
    grid-column: 1;
  }

  .app-side {
    grid-row: 1;
  }

  .app-top {
    grid-row: 2;
  }

  .portal-body .portal-page {
    grid-row: 3;
  }

  .side-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
  }

  .side-label {
    width: 100%;
  }

  .isp-metrics,
  .isp-actions,
  .isp-split {
    grid-template-columns: 1fr;
  }
}

.portal-body,
.login-body {
  --line: #e3e8f0;
  --paper: #f4f6f9;
  --ink: #1c2434;
  --muted: #5c6b82;
  --font: Inter, "Segoe UI", sans-serif;
  --display: Inter, "Segoe UI", sans-serif;
  font-family: Inter, "Segoe UI", sans-serif;
  color: #1c2434;
  background: #f4f6f9;
}

.portal-body h1,
.portal-body h2,
.portal-body h3,
.login-body h1,
.login-body h2 {
  font-family: Inter, "Segoe UI", sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.portal-body .kicker {
  margin: 0 0 0.28rem;
  color: #0f6ba8;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.portal-body .page-head h1 {
  font-size: 1.85rem;
  color: #102033;
}

.isp-date {
  color: #5c6b82;
}

.isp-metric,
.isp-card,
.portal-body .panel-card {
  border: 1px solid rgba(11, 45, 74, 0.08);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(7, 27, 47, 0.05);
}

.isp-metric-title,
.isp-metric strong,
.isp-view {
  font-weight: 600;
}

.isp-metric strong {
  color: #1c2434;
  font-size: 1.55rem;
}

.column h2 {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.stock-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.stock-toolbar input,
.stock-toolbar select {
  height: 40px;
  border: 1px solid #e3e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 0 0.75rem;
  font: inherit;
  color: #1c2434;
}

.stock-toolbar input {
  flex: 1 1 16rem;
}

.stock-toolbar .btn {
  height: 40px;
  flex: 0 0 auto;
}

.stock-count {
  margin: 0;
  color: #5c6b82;
  font-size: 0.88rem;
}

.table-wrap {
  overflow: auto;
  background: #fff;
  border: 1px solid #e3e8f0;
  border-radius: 10px;
}

.stock-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.stock-table th {
  text-align: left;
  padding: 0.7rem 0.85rem;
  color: #5c6b82;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: #f7f9fc;
}

.stock-table td {
  padding: 0.65rem 0.85rem;
  border-top: 1px solid #eef1f6;
  vertical-align: middle;
}

.stock-table a {
  color: #1c2434;
  font-weight: 600;
  text-decoration: none;
}

.stock-table a:hover {
  color: #2f6fed;
}

.stock-table .sku {
  color: #5c6b82;
  font-variant-numeric: tabular-nums;
}

.stock-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.stock-table th.num {
  text-align: right;
}

.stock-table .is-low {
  color: #9a3412;
  font-weight: 600;
}

.isp-actions {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.login-address {
  display: none;
}

.desk {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: calc(100vh - 11rem);
  border: 1px solid #e3e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.desk-side {
  border-right: 1px solid #e3e8f0;
  background: #f7f9fc;
  overflow: auto;
  padding: 0.35rem 0 1rem;
}

.desk-side h2 {
  margin: 1rem 1rem 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b778c;
}

.desk-empty {
  margin: 0 1rem 0.4rem;
  color: #6b778c;
  font-size: 0.9rem;
}

.desk-main .desk-empty {
  margin: 0;
}

.desk-row {
  display: grid;
  gap: 0.1rem;
  padding: 0.55rem 1rem;
  text-decoration: none;
  color: inherit;
  border-top: 1px solid #e8edf4;
}

.desk-row strong {
  font-weight: 600;
  font-size: 0.92rem;
}

.desk-row span {
  color: #5c6b82;
  font-size: 0.8rem;
}

.desk-row:hover {
  background: #eef3f9;
}

.desk-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.desk-thread {
  flex: 1 1 auto;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
}

.desk-msg {
  max-width: 40rem;
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
}

.desk-msg p {
  margin: 0;
  white-space: pre-wrap;
}

.desk-who {
  margin-bottom: 0.25rem !important;
  color: #6b778c;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.desk-msg-user {
  align-self: flex-end;
  background: #eef2f8;
}

.desk-msg-assistant {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e3e8f0;
}

.desk-plan {
  align-self: stretch;
  border: 1px solid #e3e8f0;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: #f8fafc;
}

.desk-plan h3,
.desk-plan h4 {
  margin: 0.8rem 0 0.35rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.desk-plan h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0;
}

.desk-plan ol,
.desk-plan ul {
  margin: 0;
  padding-left: 1.15rem;
}

.desk-plan textarea,
.desk-write textarea {
  width: 100%;
  border: 1px solid #e3e8f0;
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  line-height: 1.45;
}

.desk-stock {
  margin: 0.6rem 0 0;
  color: #5c6b82;
  font-size: 0.88rem;
}

.desk-compose {
  border-top: 1px solid #e3e8f0;
  padding: 0.75rem 1rem 0.9rem;
  background: #fff;
}

.desk-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}

.desk-write {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: end;
}

.desk-write .btn {
  height: 42px;
  padding: 0 1rem;
}

#engine-label {
  margin: 0;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: #eef2f8;
  color: #3d4b63;
  font-size: 0.78rem;
  font-weight: 600;
}

@media (max-width: 860px) {
  .desk {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .desk-side {
    border-right: 0;
    border-bottom: 1px solid #e3e8f0;
    max-height: 16rem;
  }

  .desk-write {
    grid-template-columns: 1fr;
  }
}

.portal-body .btn,
.login-body .btn,
.portal-body .top-coverage,
.portal-body .tab-btn,
.portal-body .chip,
.portal-body .chip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 0.8rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #1c2434;
  box-shadow: none;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.portal-body .btn:hover,
.login-body .btn:hover,
.portal-body .top-coverage:hover,
.portal-body .tab-btn:hover,
.portal-body .chip:hover,
.portal-body .chip-btn:hover {
  background: #eef1f6;
  color: #1c2434;
}

.portal-body .btn-dark,
.login-body .btn-dark,
.portal-body .tab-btn.is-active,
.portal-body .tab-btn.tab-admin.is-active {
  background: #1c2434;
  color: #fff;
}

.portal-body .btn-dark:hover,
.login-body .btn-dark:hover,
.portal-body .tab-btn.is-active:hover,
.portal-body .tab-btn.tab-admin.is-active:hover {
  background: #2a3344;
  color: #fff;
}

.portal-body .btn-danger,
.portal-body .btn-danger:hover {
  background: transparent;
  color: #8f3a28;
}

.portal-body .link-btn,
.login-body .link-btn {
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: #1c2434;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.portal-body .link-btn.danger,
.portal-body .link-btn.danger:hover {
  color: #8f3a28;
  background: none;
}

.portal-body .password-toggle,
.login-body .password-toggle {
  background: transparent;
  color: #5c6b82;
  border-radius: 4px;
  font-weight: 600;
}

.portal-body .password-toggle:hover,
.login-body .password-toggle:hover {
  background: transparent;
  color: #1c2434;
}

.portal-body .top-signout {
  height: auto;
  padding: 0.2rem 0.15rem;
  border: 0;
  background: transparent;
  color: #c5cedd;
  font-size: 0.8rem;
  font-weight: 600;
}

.portal-body .top-search input {
  border-radius: 6px;
}

.login-body .login-submit {
  width: 100%;
  height: 40px;
}

.theme-toggle {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #1c2434;
  border-radius: 6px;
  height: 36px;
  padding: 0 0.7rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.theme-toggle:hover {
  background: #eef1f6;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="dark"] .portal-body,
html[data-theme="dark"] .login-body {
  background: #0e1522;
  color: #e6edf7;
}

html[data-theme="dark"] .app-top,
html[data-theme="dark"] .login-stage {
  background: #121a2c;
  color: #e6edf7;
  border-color: #2a3854;
}

html[data-theme="dark"] .login-top-title {
  color: #e6edf7;
}

html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .top-portal-name,
html[data-theme="dark"] .top-search input {
  color: #e6edf7;
}

html[data-theme="dark"] .top-search input,
html[data-theme="dark"] .portal-body input,
html[data-theme="dark"] .portal-body select,
html[data-theme="dark"] .portal-body textarea,
html[data-theme="dark"] .login-body input {
  background: #172033;
  color: #e6edf7;
  border-color: #2a3854;
}

html[data-theme="dark"] .dash-panel,
html[data-theme="dark"] .settings-card,
html[data-theme="dark"] .isp-action,
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .leads-table,
html[data-theme="dark"] .dash-table,
html[data-theme="dark"] .kpi-strip,
html[data-theme="dark"] .desk,
html[data-theme="dark"] .stat-card {
  background: #172033;
  color: #e6edf7;
  border-color: #2a3854;
}

html[data-theme="dark"] .portal-body h1,
html[data-theme="dark"] .portal-body h2,
html[data-theme="dark"] .portal-body h3,
html[data-theme="dark"] .login-body h2 {
  color: #f4f7fb;
}

html[data-theme="dark"] .section-intro,
html[data-theme="dark"] .login-hint,
html[data-theme="dark"] .dash-rows dt,
html[data-theme="dark"] .cat-meta {
  color: #a8b6c9;
}

html[data-theme="dark"] .theme-toggle:hover {
  background: #243044;
}

.side-switch {
  display: block;
  margin: 0 0.45rem 0.7rem;
  color: #9aabc4;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.side-switch:hover {
  color: #fff;
}

.top-portal-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1c2434;
}

.portal-choice {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 0.2rem;
}

.desk-write .btn {
  height: 36px;
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
}

.settings-panel[hidden] {
  display: none !important;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0;
}

.settings-card {
  background: #fff;
  border: 1px solid #e3e8f0;
  border-radius: 10px;
  padding: 1rem 1.1rem 1.15rem;
}

.settings-card h2,
.settings-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
}

.settings-card h3 {
  margin-top: 0.4rem;
}

.settings-form {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  gap: 0.7rem;
}

.settings-role {
  margin: 0;
  color: #5c6b82;
  font-size: 0.9rem;
}

.settings-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem 1rem;
}

.leads-table .name-edit {
  width: 100%;
  min-width: 9rem;
  border: 1px solid #e1e6f0;
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
  font: inherit;
  background: #fff;
}

.settings-portal {
  margin-bottom: 1rem;
}

@media (max-width: 860px) {
  .settings-grid,
  .settings-columns,
  .quote-tools,
  .handoff-steps {
    grid-template-columns: 1fr;
  }

  .quote-sheet-head,
  .quote-sheet-foot {
    flex-direction: column;
  }

  .quote-meta {
    text-align: left;
  }
}

.finance-figures {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 0 0 1rem;
  border: 1px solid #e3e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.finance-figure {
  display: grid;
  gap: 0.2rem;
  padding: 0.9rem 1rem;
  border-right: 1px solid #e3e8f0;
}

.finance-figure:last-child {
  border-right: 0;
}

.finance-figure span,
.finance-figure em {
  color: #5c6b82;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 600;
}

.finance-figure strong {
  font-size: 1.15rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.leads-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 860px) {
  .finance-figures {
    grid-template-columns: 1fr 1fr;
  }

  .finance-figure:nth-child(2) {
    border-right: 0;
  }
}

.portal-body .dash-wrap {
  width: min(1240px, calc(100% - 3rem));
}

.dash-when {
  margin: 0 0 0.85rem;
  color: #5c6b82;
  font-size: 0.86rem;
  font-weight: 600;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 1.15rem;
  background:
    linear-gradient(180deg, rgba(77, 180, 234, 0.18), transparent 42%),
    #071422;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(7, 20, 34, 0.16);
}

.kpi-strip a {
  display: grid;
  gap: 0.2rem;
  padding: 1rem 1.1rem 0.95rem;
  color: #fff;
  text-decoration: none;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.kpi-strip a:last-child {
  border-right: 0;
}

.kpi-strip a:hover {
  background: rgba(255, 255, 255, 0.05);
}

.kpi-strip span,
.kpi-strip em {
  color: #9aabc4;
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kpi-strip strong {
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.dash-panel {
  background: #fff;
  border: 1px solid rgba(11, 45, 74, 0.08);
  border-radius: 16px;
  padding: 1.05rem 1.15rem 1.1rem;
  margin-bottom: 1rem;
  box-shadow: 0 10px 30px rgba(7, 27, 47, 0.05);
}

.dash-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.dash-panel-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.dash-count {
  margin-left: 0.45rem;
  color: #9a3412;
  font-size: 0.75rem;
  font-weight: 600;
}

.pipe-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
}

.pipe-col {
  display: grid;
  gap: 0.35rem;
  color: inherit;
  text-decoration: none;
}

.pipe-col strong {
  font-size: 1.25rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pipe-track {
  display: block;
  height: 6px;
  border-radius: 99px;
  background: #e7edf5;
  overflow: hidden;
}

.pipe-track i {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: 99px;
  background: #1d4e89;
}

.pipe-col em {
  color: #5c6b82;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 600;
  line-height: 1.3;
}

.dash-split {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.7fr);
  gap: 1rem;
  align-items: start;
}

.dash-split .dash-panel {
  margin-bottom: 0;
}

.dash-side {
  display: grid;
  gap: 1rem;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
}

.dash-table th {
  text-align: left;
  padding: 0 0.4rem 0.45rem;
  color: #6b778c;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dash-table td {
  padding: 0.65rem 0.4rem;
  border-top: 1px solid #eef1f6;
  vertical-align: middle;
  font-size: 0.92rem;
}

.dash-table tbody tr {
  cursor: pointer;
}

.dash-table tbody tr:hover {
  background: #f7f9fc;
}

.dash-table td strong {
  display: block;
  font-weight: 600;
}

.dash-table td span {
  color: #5c6b82;
  font-size: 0.8rem;
}

.dash-empty {
  margin: 0;
  color: #5c6b82;
}

.dash-rows {
  margin: 0;
}

.dash-rows div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-top: 1px solid #eef1f6;
}

.dash-rows dt {
  color: #5c6b82;
}

.dash-rows dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 980px) {
  .kpi-strip,
  .pipe-board,
  .dash-split {
    grid-template-columns: 1fr 1fr;
  }

  .kpi-strip a:nth-child(2) {
    border-right: 0;
  }
}

@media (max-width: 640px) {
  .kpi-strip,
  .pipe-board,
  .dash-split {
    grid-template-columns: 1fr;
  }
}

.dash-top {
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dash-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dash-pair .dash-panel {
  margin-bottom: 0;
}

.kpi-stock {
  grid-template-columns: repeat(4, 1fr);
}

.dash-main {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.7fr);
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.dash-main > .dash-panel,
.dash-rail .dash-panel {
  margin-bottom: 0;
}

.dash-rail {
  display: grid;
  gap: 1rem;
}

.cat-chart {
  display: grid;
  gap: 0.45rem;
}

.cat-row {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr) 11rem;
  gap: 0.7rem;
  align-items: center;
  color: inherit;
  text-decoration: none;
  padding: 0.28rem 0;
}

.cat-name {
  font-size: 0.86rem;
  font-weight: 600;
}

.cat-bar {
  display: block;
  height: 8px;
  border-radius: 99px;
  background: #e7edf5;
  overflow: hidden;
}

.cat-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #1d4e89, #3d7ab5);
}

.cat-meta {
  color: #5c6b82;
  font-size: 0.78rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.hold-figure {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin: 0 0 0.55rem;
}

.hold-figure strong {
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.hold-figure span,
.hold-track {
  color: #5c6b82;
}

.hold-track {
  display: block;
  height: 8px;
  margin-bottom: 0.35rem;
  border-radius: 99px;
  background: #e7edf5;
  overflow: hidden;
}

.hold-track i {
  display: block;
  height: 100%;
  background: #1d4e89;
}

.stage-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.stage-list li a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.42rem 0;
  border-top: 1px solid #eef1f6;
  color: inherit;
  text-decoration: none;
  font-size: 0.9rem;
}

.stage-list strong {
  font-variant-numeric: tabular-nums;
}

.dash-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1100px) {
  .kpi-stock,
  .dash-top,
  .dash-pair,
  .dash-main {
    grid-template-columns: 1fr 1fr;
  }

  .kpi-stock a:nth-child(2) {
    border-right: 0;
  }

  .dash-top .dash-panel:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .kpi-stock,
  .dash-top,
  .dash-pair,
  .dash-main,
  .cat-row {
    grid-template-columns: 1fr;
  }

  .cat-meta {
    text-align: left;
  }
}

html[data-theme="dark"] .portal-body .portal-page,
html[data-theme="dark"] .login-body {
  background: #0e1522;
  color: #e6edf7;
}

html[data-theme="dark"] .portal-body .page-head h1,
html[data-theme="dark"] .portal-body h1,
html[data-theme="dark"] .portal-body h2,
html[data-theme="dark"] .portal-body h3 {
  color: #f4f7fb;
}

html[data-theme="dark"] .portal-body .panel-card,
html[data-theme="dark"] .dash-panel,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .settings-card,
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .kpi-strip,
html[data-theme="dark"] .desk,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .isp-action,
html[data-theme="dark"] .app-top,
html[data-theme="dark"] .stock-table th {
  background: #172033;
  color: #e6edf7;
  border-color: #2a3854;
}

html[data-theme="dark"] .portal-body input,
html[data-theme="dark"] .portal-body select,
html[data-theme="dark"] .portal-body textarea,
html[data-theme="dark"] .stock-toolbar input,
html[data-theme="dark"] .stock-toolbar select,
html[data-theme="dark"] .login-body input {
  background: #121a2c;
  color: #e6edf7;
  border-color: #2a3854;
}

html[data-theme="dark"] .leads-table th,
html[data-theme="dark"] .leads-table td,
html[data-theme="dark"] .stock-table td,
html[data-theme="dark"] .stock-table a,
html[data-theme="dark"] .leads-table a,
html[data-theme="dark"] .section-intro,
html[data-theme="dark"] .stock-count {
  color: #e6edf7;
  border-color: #2a3854;
}

.portal-body .page-head {
  align-items: flex-end;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(11, 45, 74, 0.08);
}

.table-wrap,
.portal-body .table-wrap {
  border: 1px solid rgba(11, 45, 74, 0.08);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(7, 27, 47, 0.05);
  background: #fff;
}

.leads-table th {
  background: #f6f9fc;
  color: #5c6b82;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.leads-table tbody tr:last-child td {
  border-bottom: 0;
}

.stat-card {
  border: 1px solid rgba(11, 45, 74, 0.08);
  border-left-width: 0;
  border-radius: 16px;
  padding: 1.05rem 1.15rem;
  box-shadow: 0 10px 30px rgba(7, 27, 47, 0.05);
}

.stat-card strong {
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}

.dash-panel-head h2 {
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.dash-when {
  margin: 0 0 1rem;
  color: #5c6b82;
  font-size: 0.92rem;
  font-weight: 500;
}

.top-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(145deg, #1683c7, #0d4f7c);
  font-size: 0.74rem;
}

.side-foot {
  margin-top: 0.8rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.side-foot .top-name,
.side-foot .top-account {
  color: #fff;
}

.side-foot .role-pill {
  margin-left: 0;
  margin-top: 0.2rem;
  background: rgba(77, 180, 234, 0.16);
  color: #b9dff6;
}

.theme-toggle {
  border: 1px solid rgba(11, 45, 74, 0.12);
  background: #fff;
  border-radius: 999px;
  padding: 0 0.9rem;
}

.portal-body .btn,
.login-body .btn {
  border-radius: 999px;
  height: 38px;
  padding: 0 1rem;
  border: 1px solid rgba(11, 45, 74, 0.14);
  background: #fff;
  box-shadow: none;
}

.portal-body .btn-dark,
.login-body .btn-dark {
  border-color: transparent;
  background: linear-gradient(180deg, #12304d, #071422);
  color: #fff;
  box-shadow: 0 8px 18px rgba(7, 20, 34, 0.18);
}

.portal-body .btn-dark:hover,
.login-body .btn-dark:hover {
  background: #0d4f7c;
  color: #fff;
}

.portal-body .btn-danger,
.portal-body .btn-danger:hover {
  background: #fff;
  border-color: rgba(169, 71, 51, 0.35);
  color: #a94733;
  box-shadow: none;
}

.login-body .login-card,
.portal-body .login-card {
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(7, 20, 34, 0.12);
}

html[data-theme="dark"] .portal-body {
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(22, 131, 199, 0.16), transparent 50%),
    #0e1522;
}

html[data-theme="dark"] .app-top {
  background: rgba(18, 26, 44, 0.9);
}

html[data-theme="dark"] .portal-body .page-head {
  border-bottom-color: #2a3854;
}

html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .portal-body .table-wrap,
html[data-theme="dark"] .leads-table th {
  background: #172033;
  color: #a8b6c9;
}

html[data-theme="dark"] .theme-toggle {
  background: #172033;
  color: #e6edf7;
  border-color: #2a3854;
}

.login-body.portal-body .portal-page .wrap {
  width: min(460px, calc(100% - 2.4rem));
  margin-inline: auto;
}

.login-body .page-head {
  justify-content: center;
  text-align: center;
  border-bottom: 0;
}

.sales-kpis {
  margin-bottom: 1rem;
}

.sales-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.metric-card h2 {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5c6b82;
}

.metric-card .dash-panel-head {
  margin-bottom: 0.35rem;
}

.metric-card .dash-panel-head h2 {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5c6b82;
}

.metric-figure {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.metric-note {
  margin: 0.45rem 0 0;
  color: #5c6b82;
  font-size: 0.86rem;
  line-height: 1.35;
}

.target-form {
  display: flex;
  align-items: end;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.target-form label {
  flex: 1;
  font-size: 0.78rem;
  color: #5c6b82;
}

.target-form input {
  width: 100%;
  margin-top: 0.2rem;
}

.target-track {
  margin-top: 0.35rem;
}

.dash-trio {
  display: grid;
  grid-template-columns: 1.15fr 1fr 0.9fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.note-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.note-list li + li {
  border-top: 1px solid rgba(11, 45, 74, 0.08);
}

.note-list a {
  display: block;
  padding: 0.55rem 0;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.note-list a:hover {
  color: #1683c7;
}

html[data-theme="dark"] .metric-card h2,
html[data-theme="dark"] .metric-card .dash-panel-head h2,
html[data-theme="dark"] .metric-note,
html[data-theme="dark"] .target-form label {
  color: #a8b6c9;
}

html[data-theme="dark"] .note-list li + li {
  border-top-color: #2a3854;
}

html[data-theme="dark"] .hold-track,
html[data-theme="dark"] .target-track {
  background: #243044;
}

@media (max-width: 1100px) {
  .sales-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .dash-trio {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .sales-metrics {
    grid-template-columns: 1fr;
  }
}

.lead-tools {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.75rem;
}

.lead-tools label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5c6b82;
}

.lead-count {
  margin: 0 0 0.75rem;
  color: #5c6b82;
  font-size: 0.88rem;
}

.leads-table .assign-select {
  width: 100%;
  min-width: 8rem;
}

.leads-table .lead-sub {
  display: block;
  color: #5c6b82;
  font-size: 0.82rem;
  font-weight: 500;
}

.lead-sheet h3 {
  margin-top: 0;
}

.lead-sheet input[readonly] {
  background: #f4f7fb;
  color: #334155;
}

.lead-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1.2rem;
  margin: 0 0 1rem;
}

.lead-facts div {
  margin: 0;
}

.lead-facts dt {
  margin: 0 0 0.15rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5c6b82;
}

.lead-facts dd {
  margin: 0;
}

html[data-theme="dark"] .lead-sheet input[readonly] {
  background: #121a2c;
  color: #d5deea;
}

@media (max-width: 700px) {
  .lead-facts {
    grid-template-columns: 1fr;
  }
}

.quote-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}

.quote-filters button {
  border: 1px solid rgba(11, 45, 74, 0.12);
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.quote-filters button span {
  color: #5c6b82;
  margin-left: 0.25rem;
}

.quote-filters button.is-on {
  background: #071422;
  color: #fff;
  border-color: #071422;
}

.quote-filters button.is-on span {
  color: #c5d4e8;
}

.quote-track {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  margin: 0 0 0.9rem;
  padding: 0;
}

.quote-track li {
  flex: 1;
  text-align: center;
  padding: 0.55rem 0.4rem;
  border-radius: 999px;
  background: #eef3f8;
  font-weight: 700;
  font-size: 0.86rem;
}

.quote-track li.is-done {
  background: #d9f2e4;
}

.quote-track li.is-current {
  background: #071422;
  color: #fff;
}

.quote-track li.is-declined {
  background: #fde8e8;
}

.quote-actions {
  margin-bottom: 1rem;
}

.quote-build-line {
  display: grid;
  grid-template-columns: 1.2fr 1.3fr 0.6fr 0.7fr auto auto;
  gap: 0.55rem;
  align-items: end;
  margin-bottom: 0.7rem;
}

.quote-build-line label {
  display: grid;
  gap: 0.2rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #5c6b82;
}

.quote-build-totals {
  margin-left: auto;
  min-width: 240px;
}

.quote-lines input {
  width: 100%;
}

.pill.stock-in_stock { background: #d9f2e4; }
.pill.stock-low { background: #fff3d6; }
.pill.stock-out { background: #fde8e8; }

.pill.prio-low { background: #e7eef6; }
.pill.prio-normal { background: #d9e8f8; }
.pill.prio-high { background: #fff3d6; }
.pill.prio-urgent { background: #fde8e8; }
.pill.fu-open { background: #d9e8f8; }
.pill.fu-done { background: #d9f2e4; }
.pill.fu-cancelled { background: #e8edf3; }

@media (max-width: 900px) {
  .quote-build-line,
  .quote-track {
    grid-template-columns: 1fr 1fr;
    display: grid;
  }
}

@media (max-width: 980px) {
  .lead-tools {
    grid-template-columns: 1fr 1fr;
  }
}

.report-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.report-charts,
.report-split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: start;
}

.report-charts .dash-panel,
.report-split .dash-panel {
  margin-bottom: 0;
}

.report-table tbody tr,
.report-table tbody tr:hover {
  cursor: default;
}

.trend-chart {
  width: 100%;
  overflow: hidden;
}

.trend-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.trend-chart text {
  fill: #5c6b82;
  font-size: 11px;
  font-family: Inter, sans-serif;
}

.trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 0.7rem 0 0;
  color: #5c6b82;
  font-size: 0.82rem;
}

.trend-legend i {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
  margin-right: 0.3rem;
  vertical-align: -1px;
}

html[data-theme="dark"] .trend-chart text {
  fill: #c5d0e0;
}

html[data-theme="dark"] .trend-chart line {
  stroke: #2a3854;
}

@media (max-width: 1100px) {
  .report-metrics,
  .report-charts,
  .report-split {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .report-metrics,
  .report-charts,
  .report-split {
    grid-template-columns: 1fr;
  }
}

.alert-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid #e0a3a0;
  border-radius: 12px;
  background: #fff6f4;
}

.alert-bar p {
  margin: 0;
}

.alert-bar .btn {
  flex: none;
}

.nav-badge {
  display: inline-block;
  min-width: 1.2rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--stop, #b42318);
  color: #fff;
  font-size: 0.72rem;
  line-height: 1.3rem;
  text-align: center;
}

.column-total {
  margin: -0.35rem 0 0.7rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.card-late {
  border-color: #e0a3a0;
}

.card-note,
.activity-list .muted {
  color: var(--muted);
  font-size: 0.82rem;
}

.stage-label {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.stage-label select {
  font: inherit;
}

.log-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.log-actions .is-on {
  background: var(--navy, #04283f);
  color: #fff;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.6rem;
  align-items: end;
  margin-bottom: 0.6rem;
}

.contact-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem;
  margin-bottom: 0.8rem;
}

.contact-card h3 {
  margin: 0;
  font-size: 1rem;
}

.activity-list p {
  margin: 0.25rem 0 0;
}

tr.is-overdue td {
  background: #fff4f2;
}

tr.is-due td {
  background: #fff8eb;
}

.pill.fu-overdue {
  background: #fde8e6;
  color: #8a1f16;
}

.pill.fu-today {
  background: #fff1d6;
  color: #8a5a00;
}

html[data-theme="dark"] .alert-bar,
html[data-theme="dark"] tr.is-overdue td {
  background: #3a2424;
  color: #f4f7fb;
}

html[data-theme="dark"] tr.is-due td {
  background: #3a3220;
}

@media (max-width: 700px) {
  .alert-bar,
  .field-row {
    grid-template-columns: 1fr;
    display: grid;
  }
}

.score-hot { background: #fde8e8; color: #9b1c1c; }
.score-warm { background: #fef3c7; color: #92400e; }
.score-cold { background: #e8eef5; color: #1d4e89; }
.forecast-row {
  display: grid;
  grid-template-columns: minmax(8rem, 1.2fr) 2fr auto;
  gap: 0.75rem;
  align-items: center;
  margin: 0.45rem 0;
}

@media (max-width: 720px) {
  .table-wrap,
  .board { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .forecast-row,
  .page-head { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .settings-columns { grid-template-columns: 1fr; }
}

.client-portal .help-thread {
  max-height: 24rem;
  overflow: auto;
  display: grid;
  gap: 0.8rem;
  margin: 0.4rem 0 1rem;
}

.client-portal .help-msg {
  border-radius: 14px;
  padding: 0.85rem 1rem;
}

.client-portal .help-msg p {
  margin: 0;
}

.client-portal .help-msg-user {
  background: #fff;
  border: 1px solid var(--line);
}

.client-portal .help-msg-assistant {
  background: #eef6fb;
  border: 1px solid var(--line);
}

.client-portal .chip-btn {
  font-size: 1rem;
  padding: 0.45rem 0.9rem;
}

/* Client portal: larger, rounder type and more space than the staff screens. */
.client-portal.portal-body,
.client-portal.login-body {
  --font: "Source Sans 3", "Segoe UI", sans-serif;
  --display: "Nunito", "Segoe UI", sans-serif;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
  background: #f3f7fb;
}

.client-portal.portal-body h1,
.client-portal.portal-body h2,
.client-portal.portal-body h3,
.client-portal.login-body h1,
.client-portal.login-body h2,
.client-portal.login-body h3 {
  font-family: "Nunito", "Segoe UI", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.client-portal .kicker {
  font-family: "Nunito", "Segoe UI", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.client-portal .page-head h1 {
  font-size: 2.2rem;
  line-height: 1.15;
}

.client-portal .section-intro,
.client-portal .login-hint,
.client-portal .dash-panel p,
.client-portal .form-error,
.client-portal .form-success {
  font-size: 1.08rem;
  line-height: 1.55;
}

.client-portal .side-brand-text small,
.client-portal .side-link,
.client-portal .top-name,
.client-portal .role-pill,
.client-portal .top-signout,
.client-portal .login-top-title {
  font-family: "Nunito", "Segoe UI", sans-serif;
}

.client-portal .side-brand-text small {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0;
  color: #d5e6f5;
}

.client-portal .side-link {
  font-size: 1.08rem;
  font-weight: 700;
  padding: 0.72rem 0.9rem;
  border-radius: 12px;
}

.client-portal .side-label {
  font-family: "Nunito", "Segoe UI", sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: none;
}

.client-portal .leads-table th,
.client-portal .leads-table td {
  font-size: 1.05rem;
  padding: 0.9rem 1rem;
  line-height: 1.45;
}

.client-portal .leads-table th {
  font-family: "Nunito", "Segoe UI", sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: #3d4d63;
}

.client-portal .dash-panel-head h2,
.client-portal .settings-card h2 {
  font-size: 1.4rem;
}

.client-portal .btn,
.client-portal button,
.client-portal .theme-toggle {
  font-family: "Nunito", "Segoe UI", sans-serif;
  font-weight: 700;
}

.client-portal .btn {
  font-size: 1.05rem;
  padding: 0.72rem 1.2rem;
  border-radius: 12px;
}

.client-portal label,
.client-portal input,
.client-portal select,
.client-portal textarea {
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 1.08rem;
}

.client-portal input,
.client-portal select,
.client-portal textarea {
  padding: 0.7rem 0.85rem;
}

.client-portal .kpi-strip strong,
.client-portal .sales-kpis strong,
.client-portal .stat-card strong {
  font-family: "Nunito", "Segoe UI", sans-serif;
  font-weight: 800;
}

.client-portal .kpi-strip span,
.client-portal .sales-kpis span,
.client-portal .kpi-strip em,
.client-portal .sales-kpis em {
  font-size: 0.98rem;
}
