:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --line: #dce3e7;
  --text: #152029;
  --muted: #64737e;
  --brand: #0f766e;
  --brand-strong: #0b5f59;
  --accent: #b7791f;
  --danger: #b42318;
  --ok: #157347;
  --shadow: 0 8px 24px rgba(20, 32, 41, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
}

button:hover {
  background: var(--brand-strong);
}

button.secondary {
  background: #eef3f4;
  color: var(--text);
}

button.warning {
  background: var(--accent);
}

button.danger {
  background: var(--danger);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 9px 10px;
  outline: none;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 600;
  background: #f9fbfb;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

.side {
  background: #17242b;
  color: #dce8ea;
  padding: 18px 14px;
}

.boss-shell .side {
  background: linear-gradient(180deg, #063d32 0%, #082922 100%);
}

.boss-shell .nav button.active,
.boss-shell .nav button:hover {
  background: #00865f;
  color: #fff;
}

.brand {
  display: grid;
  gap: 3px;
  padding: 0 6px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand strong {
  font-size: 19px;
}

.brand span {
  color: #9fb0b8;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 6px;
  margin-top: 16px;
}

.nav button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  background: transparent;
  color: #dce8ea;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.main {
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfc;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.boss-product-card {
  border-color: #d7eee5;
  background: linear-gradient(180deg, #ffffff 0%, #f8fcfa 100%);
}

.boss-product-main {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: stretch;
  margin: 14px 0;
}

.loan-cover {
  min-height: 150px;
  border-radius: 8px;
  padding: 18px;
  color: #fff;
  background: linear-gradient(135deg, #005b44 0%, #00a878 58%, #f2b84b 100%);
  display: grid;
  align-content: center;
  gap: 8px;
  overflow: hidden;
}

.loan-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 6px;
}

.loan-cover b {
  font-size: 26px;
}

.finance-spec {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.finance-spec div,
.finance-stats .metric {
  border: 1px solid #e2efe9;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.finance-spec span {
  display: block;
  color: #64737e;
  font-size: 12px;
}

.finance-spec b {
  display: block;
  margin-top: 4px;
  color: #0f2f27;
}

.finance-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.finance-form {
  display: grid;
  gap: 14px;
}

.finance-section {
  border-color: #d7eee5;
}

.finance-section h2 {
  color: #006f52;
}

.finance-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.finance-check {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #d7eee5;
  border-radius: 999px;
  background: #f3fbf8;
  color: #0f2f27;
}

.finance-check input {
  width: auto;
}

@media (max-width: 1100px) {
  .boss-product-main {
    grid-template-columns: 1fr;
  }
}

.form-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 24px;
}

.login-card p {
  margin: 0 0 18px;
  color: var(--muted);
}

.login-card form {
  display: grid;
  gap: 12px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(440px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #152029;
  color: #fff;
  box-shadow: var(--shadow);
  z-index: 20;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: #eef3f4;
  color: var(--text);
  font-size: 12px;
}

.badge.ok {
  background: #e8f5ee;
  color: var(--ok);
}

.badge.warn {
  background: #fff4df;
  color: #95600f;
}

.badge.bad {
  background: #fdecec;
  color: var(--danger);
}

.mobile-shell {
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: #fff;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.mobile-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.mobile-head strong {
  display: block;
  font-size: 18px;
}

.mobile-head span {
  color: var(--muted);
  font-size: 12px;
}

.mobile-body {
  padding: 14px;
  padding-bottom: 78px;
}

.tabs {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: min(480px, 100vw);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line);
  background: #fff;
}

.tabs button {
  height: 56px;
  border-radius: 0;
  background: #fff;
  color: var(--muted);
  padding: 0;
}

.tabs button.active {
  color: var(--brand);
  background: #eef8f7;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .side {
    position: sticky;
    top: 0;
    z-index: 4;
  }
  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .main {
    padding: 14px;
  }
  .grid,
  .grid.three,
  .grid.two,
  .form-row {
    grid-template-columns: 1fr;
  }
}

.agent-app {
  --agent-green: #00865f;
  --agent-green-dark: #00704f;
  --agent-soft: #f3f7f7;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: #f6f8f9;
  color: #111827;
  position: relative;
  overflow: hidden;
}

.agent-header {
  min-height: 150px;
  padding: 20px 18px 48px;
  color: #fff;
  background:
    radial-gradient(circle at 84% 12%, rgba(255, 255, 255, 0.14), transparent 24%),
    linear-gradient(135deg, #007052 0%, #00986f 100%);
}

.agent-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.agent-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bull {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 800;
  font-size: 24px;
  overflow: hidden;
}

.bull img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.auth-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  margin: 0;
  overflow: hidden;
  background: transparent;
  color: #00865f;
  font-size: 24px;
  font-weight: 900;
}

.auth-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.auth-brand h1 {
  margin: 0;
  color: #00865f;
}

.auth-brand p {
  margin: 2px 0 0;
}

.agent-logo strong {
  display: block;
  font-size: 24px;
  letter-spacing: 0;
}

.agent-logo span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  opacity: 0.86;
}

.bell {
  position: relative;
  width: 42px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 20px;
}

.bell svg,
.iconbox svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bell i {
  position: absolute;
  right: -4px;
  top: -5px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ef1717;
  color: #fff;
  font-size: 12px;
  font-style: normal;
  display: grid;
  place-items: center;
}

.notify-pop {
  position: absolute;
  right: 14px;
  top: 74px;
  z-index: 8;
  width: min(330px, calc(100vw - 28px));
  padding: 12px;
  border-radius: 14px;
  background: #fff;
  color: #111827;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
}

.notify-pop h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.notify-pop button {
  width: 100%;
  height: auto;
  min-height: 54px;
  margin-top: 6px;
  padding: 10px;
  border-radius: 10px;
  background: #f7faf9;
  color: #111827;
  text-align: left;
}

.notify-pop b,
.notify-pop span {
  display: block;
}

.notify-pop span {
  margin-top: 4px;
  color: #64737e;
  font-size: 12px;
}

.agent-content {
  padding: 0 14px 84px;
  margin-top: -36px;
}

.agent-card {
  background: #fff;
  border: 1px solid #edf1f3;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(24, 39, 50, 0.08);
  padding: 16px;
  margin-bottom: 12px;
}

.agent-card h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.agent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.agent-profile-icon {
  width: 70px;
  height: 70px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: linear-gradient(145deg, #11c894, #007d5b);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 30px;
  font-weight: 800;
}

.agent-code {
  font-size: 18px;
  font-weight: 800;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eaf7f1;
  color: #00865f;
  font-size: 12px;
  font-weight: 700;
}

.pill.orange {
  background: #fff0e2;
  color: #f97316;
}

.pill.blue {
  background: #e8f1ff;
  color: #1369e8;
}

.pill.gray {
  background: #eef0f3;
  color: #64737e;
}

.logo-preview {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border: 1px solid #dce3e7;
  border-radius: 14px;
  background: #eef3f4;
  color: #64737e;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
}

.logo-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.metric-strip.four {
  grid-template-columns: repeat(4, 1fr);
}

.metric-cell {
  min-width: 0;
  padding: 8px 6px;
  border-right: 1px solid #edf1f3;
  text-align: center;
}

.metric-cell:last-child {
  border-right: 0;
}

.metric-cell b {
  display: block;
  margin-top: 3px;
  font-size: 22px;
  line-height: 1.1;
}

.metric-cell span {
  display: block;
  overflow-wrap: anywhere;
  color: #5f6d7a;
  font-size: 11px;
}

.follow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.follow-item {
  min-width: 0;
  border: 1px solid #edf1f3;
  border-radius: 12px;
  padding: 8px 4px;
  background: #fbfcfc;
  text-align: center;
}

.follow-item strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  line-height: 1.1;
}

.follow-item span {
  display: block;
  overflow-wrap: anywhere;
  color: #64737e;
  font-size: 11px;
}

.mini-list {
  display: grid;
}

.customer-line,
.config-line,
.product-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #edf1f3;
}

.customer-line.clickable {
  cursor: pointer;
}

.customer-line.clickable:hover {
  background: #f8fbfa;
}

.customer-detail-head {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 0 4px;
}

.customer-detail-head h2 {
  margin: 0 0 4px;
}

.avatar.big {
  width: 54px;
  height: 54px;
  font-size: 20px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.detail-grid div {
  border: 1px solid #edf1f3;
  border-radius: 12px;
  padding: 10px;
  background: #fbfcfc;
}

.detail-grid span,
.detail-grid b {
  display: block;
}

.detail-grid span {
  color: #64737e;
  font-size: 12px;
}

.detail-grid b {
  margin-top: 4px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.customer-line:last-child,
.config-line:last-child,
.product-line:last-child {
  border-bottom: 0;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #00986f;
  font-weight: 800;
}

.sub {
  color: #64737e;
  font-size: 12px;
}

.toolbar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.toolbar button {
  flex: 0 0 auto;
  background: #fff;
  color: #596777;
  border: 1px solid #dce3e7;
}

.toolbar button.active {
  color: #00865f;
  border-color: #00865f;
  background: #eefaf6;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.promo-stack {
  display: grid;
  gap: 12px;
}

.promo-row {
  min-height: 64px;
}

.qr-panel {
  border: 1px solid #edf1f3;
  border-radius: 14px;
  padding: 14px;
  background: #fbfcfc;
  display: grid;
  gap: 12px;
}

.qr-panel canvas {
  width: min(240px, 100%);
  height: auto;
  justify-self: center;
  border: 10px solid #fff;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.quick {
  min-height: 78px;
  border: 1px solid #edf1f3;
  border-radius: 12px;
  background: #fbfcfc;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  color: #111827;
}

.quick .iconbox,
.iconbox {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: linear-gradient(145deg, #00a878, #007d5b);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.iconbox.blue {
  background: linear-gradient(145deg, #3b82f6, #1769e0);
}

.iconbox.orange {
  background: linear-gradient(145deg, #fb923c, #f97316);
}

.iconbox.gray {
  background: linear-gradient(145deg, #a5adba, #6b7280);
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.config-tile {
  min-height: 86px;
  border: 1px solid #edf1f3;
  border-radius: 14px;
  background: #fbfcfc;
  color: #111827;
  display: grid;
  place-items: center;
  gap: 7px;
  padding: 10px 4px;
}

.config-tile .iconbox {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.config-tile b {
  font-size: 13px;
}

.agent-tabs {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 10;
  width: min(480px, 100vw);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid #edf1f3;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.agent-tabs button {
  height: 56px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #6b7280;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
}

.agent-tabs b {
  display: none;
}

.agent-tabs button.active {
  color: #00865f;
  background: #f1fbf7;
}

.agent-form {
  display: grid;
  gap: 12px;
}

.agent-form .split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.agent-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 10px;
}

.empty {
  padding: 16px;
  text-align: center;
  color: #64737e;
}

@media (max-width: 420px) {
  .agent-content {
    padding-left: 12px;
    padding-right: 12px;
  }
  .agent-card {
    padding: 12px;
    border-radius: 16px;
  }
  .metric-strip.four .metric-cell {
    padding: 7px 3px;
  }
  .metric-strip.four .metric-cell b {
    font-size: 20px;
  }
  .metric-strip.four .metric-cell span,
  .follow-item span {
    font-size: 10px;
  }
  .follow-item .pill {
    min-height: 20px;
    padding: 0 5px;
    font-size: 10px;
    justify-content: center;
  }
  .follow-item strong {
    font-size: 18px;
  }
  .agent-form .split {
    grid-template-columns: 1fr;
  }
}

/* Boss PC dashboard */
.boss-shell {
  grid-template-columns: 240px minmax(0, 1fr);
  background: #f5f7fa;
}

.boss-shell .side {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 240px;
  padding: 20px 10px 18px;
  background: radial-gradient(circle at 20% 0%, rgba(37, 99, 235, 0.22), transparent 34%), linear-gradient(180deg, #061b3d 0%, #031529 100%);
  display: flex;
  flex-direction: column;
}

.boss-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px 16px;
  border-bottom: 0;
}

.boss-brand-mark {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  color: #fff7d2;
  font-weight: 900;
  font-size: 14px;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.boss-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.boss-brand strong {
  color: #fff;
  font-size: 16px;
  line-height: 1.2;
}

.boss-brand span {
  display: block;
  margin-top: 3px;
  color: #a9bad4;
  font-size: 12px;
}

.boss-shell .nav {
  gap: 8px;
  margin-top: 8px;
}

.boss-shell .nav button {
  height: 48px;
  min-height: 48px;
  border-radius: 10px;
  padding: 0 14px;
  color: #d8e4f5;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 650;
}

.boss-shell .nav button.active,
.boss-shell .nav button:hover {
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}

.nav-ico {
  width: 20px;
  color: currentColor;
  text-align: center;
  font-weight: 800;
}

.boss-side-profile {
  margin-top: auto;
  padding: 16px 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.boss-side-profile span {
  display: block;
  color: #a9bad4;
  font-size: 12px;
}

.boss-side-actions {
  flex: 0 0 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.boss-side-actions button {
  height: 34px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: #dbeafe;
  border-radius: 8px;
  cursor: pointer;
}

.boss-side-actions .danger-text {
  color: #fecaca;
}

.boss-avatar,
.small-avatar {
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
}

.boss-avatar {
  width: 44px;
  height: 44px;
  font-size: 12px;
  font-weight: 800;
}

.small-avatar {
  width: 26px;
  height: 26px;
  margin-right: 8px;
  font-size: 12px;
}

.boss-shell .main {
  padding: 24px;
  background: #f5f7fa;
}

.boss-topbar {
  margin-bottom: 14px;
}

.boss-topbar h1 {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
}

.boss-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.boss-btn {
  height: 40px;
  min-height: 40px;
  border: 1px solid #d7dee8;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.boss-btn:hover {
  background: #f8fafc;
}

.boss-btn.primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.boss-btn.primary:hover {
  background: #1d4ed8;
}

.boss-btn.danger-text {
  color: #ef4444;
}

.boss-card,
.boss-status-card,
.boss-kpi-card {
  background: #fff;
  border: 1px solid #e5eaf0;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.boss-card {
  padding: 14px 16px;
  min-width: 0;
}

.boss-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.boss-card-title h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.boss-card-title a,
.boss-table a,
.todo-row a {
  color: #2563eb;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}

.boss-status-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.boss-status-card {
  height: 64px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.boss-status-card span:not(.boss-round-icon) {
  display: block;
  color: #64748b;
  font-size: 12px;
}

.boss-status-card strong {
  font-size: 15px;
}

.boss-status-card strong.green,
.boss-round-icon.green {
  color: #16a34a;
}

.boss-status-card strong.blue,
.boss-round-icon.blue {
  color: #2563eb;
}

.boss-status-card strong.orange,
.boss-round-icon.orange {
  color: #f59e0b;
}

.boss-round-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 9px;
  flex: 0 0 auto;
}

.boss-round-icon.blue { background: #dbeafe; }
.boss-round-icon.orange { background: #ffedd5; }
.boss-round-icon.green { background: #dcfce7; }
.boss-round-icon.purple { color: #9333ea; background: #f3e8ff; }
.boss-round-icon.indigo { color: #4f46e5; background: #e0e7ff; }
.boss-round-icon.emerald { color: #059669; background: #d1fae5; }
.boss-round-icon.sky { color: #0284c7; background: #e0f2fe; }
.boss-round-icon.red { color: #ef4444; background: #fee2e2; }

.boss-kpi-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.boss-kpi-card {
  height: 110px;
  padding: 14px 12px;
  display: grid;
  align-content: space-between;
}

.boss-kpi-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.boss-kpi-head .boss-round-icon {
  width: 34px;
  height: 34px;
}

.boss-kpi-head b {
  color: #172033;
  font-size: 13px;
}

.boss-kpi-card > strong {
  color: #0f172a;
  font-size: 30px;
  line-height: 1;
}

.trend {
  font-size: 12px;
  font-weight: 700;
}

.trend.up {
  color: #ef4444;
}

.trend.down {
  color: #16a34a;
}

.boss-mid-grid {
  display: grid;
  grid-template-columns: 40fr 28fr 32fr;
  gap: 12px;
  margin-bottom: 12px;
  align-items: stretch;
}

.boss-mid-grid-compact {
  grid-template-columns: 58fr 42fr;
}

.boss-bottom-grid {
  display: grid;
  grid-template-columns: 48fr 52fr;
  gap: 12px;
  margin-bottom: 14px;
}

.funnel-layout {
  display: grid;
  grid-template-columns: 46% 1fr;
  gap: 16px;
  align-items: center;
}

.funnel-visual {
  display: grid;
  gap: 5px;
  justify-items: center;
  padding: 8px 0;
}

.funnel-slice {
  height: 30px;
  clip-path: polygon(7% 0, 93% 0, 82% 100%, 18% 100%);
}

.funnel-slice.s0 { width: 86%; background: linear-gradient(90deg, #2563eb, #3b82f6); }
.funnel-slice.s1 { width: 74%; background: linear-gradient(90deg, #0891b2, #22d3ee); }
.funnel-slice.s2 { width: 62%; background: linear-gradient(90deg, #10b981, #6ee7b7); }
.funnel-slice.s3 { width: 50%; background: linear-gradient(90deg, #facc15, #fde047); }
.funnel-slice.s4 { width: 38%; background: linear-gradient(90deg, #fb923c, #fdba74); }
.funnel-slice.s5 { width: 26%; background: linear-gradient(90deg, #f43f5e, #fb7185); }

.boss-mini-table,
.boss-table {
  font-size: 12px;
}

.boss-table {
  table-layout: fixed;
}

.boss-mini-table th,
.boss-mini-table td,
.boss-table th,
.boss-table td {
  padding: 8px 8px;
  border-bottom: 1px solid #e5eaf0;
  white-space: nowrap;
}

.boss-bottom-grid .boss-table th,
.boss-bottom-grid .boss-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.boss-mini-table th,
.boss-table th {
  color: #475569;
  background: #f8fafc;
  font-weight: 800;
}

.boss-card-foot {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e5eaf0;
  color: #334155;
}

.todo-list {
  display: grid;
}

.todo-row {
  min-height: 48px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #e5eaf0;
}

.todo-row:last-child {
  border-bottom: 0;
}

.todo-row b {
  color: #172033;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.core-tag {
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 7px;
  background: #dbeafe;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
}

.boss-shell .boss-product-card {
  border-color: #e5eaf0;
  background: #fff;
  padding: 12px;
}

.boss-shell .boss-product-main {
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  margin: 0 0 10px;
}

.boss-shell .loan-cover {
  min-height: 112px;
  border-radius: 10px;
  padding: 14px;
  position: relative;
  background: linear-gradient(135deg, #164bbf 0%, #2563eb 46%, #f7b733 100%);
}

.boss-shell .loan-cover b {
  font-size: 20px;
  position: relative;
  z-index: 1;
}

.boss-shell .loan-cover span {
  font-size: 12px;
  position: relative;
  z-index: 1;
}

.boss-shell .loan-cover em {
  position: absolute;
  right: 12px;
  bottom: 8px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 30px;
  font-style: normal;
  font-weight: 900;
  background: rgba(251, 191, 36, 0.86);
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.22);
}

.boss-shell .finance-spec {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
}

.boss-shell .finance-spec div {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.boss-shell .finance-spec span {
  display: inline-block;
  min-width: 62px;
  margin-right: 8px;
  color: #64748b;
  font-size: 12px;
}

.boss-shell .finance-spec b {
  display: inline;
  margin: 0;
  color: #0f172a;
  font-size: 12px;
}

.boss-shell .finance-stats {
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.boss-shell .finance-stats .metric {
  text-align: center;
  padding: 8px;
  background: #f8fafc;
  border-color: #e5eaf0;
}

.boss-shell .finance-stats .metric strong {
  font-size: 18px;
}

.boss-shell .boss-product-card .actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.boss-shell .boss-product-card .actions button {
  height: 34px;
  min-height: 34px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
}

.field-preview {
  padding-top: 8px;
  border-top: 1px solid #e5eaf0;
}

.field-preview h3 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #0f172a;
}

.field-preview div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.field-preview span {
  min-height: 32px;
  border: 1px solid #dbeafe;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #2563eb;
  background: #f8fbff;
  font-size: 12px;
  font-weight: 700;
}

.staff-cell {
  display: inline-flex;
  align-items: center;
}

.progress {
  width: 64px;
  height: 4px;
  margin-right: 8px;
  border-radius: 999px;
  background: #e5eaf0;
  display: inline-block;
  vertical-align: middle;
  overflow: hidden;
}

.progress i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #0ea5e9);
}

.customer-tag {
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
}

.customer-tag.new {
  color: #2563eb;
  background: #dbeafe;
}

.customer-tag.contacted {
  color: #ea580c;
  background: #ffedd5;
}

.customer-tag.valid {
  color: #16a34a;
  background: #dcfce7;
}

.customer-tag.closed {
  color: #7c3aed;
  background: #ede9fe;
}

.sep {
  margin: 0 6px;
  color: #cbd5e1;
}

.boss-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  color: #64748b;
  font-size: 12px;
}

.boss-footer span:last-child {
  text-align: right;
}

.clickable,
.clickable-row,
.linkish {
  cursor: pointer;
}

.boss-status-card.clickable:hover,
.boss-kpi-card.clickable:hover,
.boss-card .metric.clickable:hover,
.loan-cover.clickable:hover,
.field-preview span.clickable:hover {
  transform: translateY(-2px);
  border-color: #2563eb;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.14);
}

.boss-status-card,
.boss-kpi-card,
.boss-card .metric,
.loan-cover,
.field-preview span {
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.boss-table tr:hover,
.boss-mini-table tr:hover,
.clickable-row:hover {
  background: #eff6ff;
}

.linkish,
.boss-table .linkish,
.detail-link {
  color: #2563eb;
  font-weight: 700;
}

.detail-link {
  justify-self: end;
  font-size: 12px;
  text-decoration: none;
}

.funnel-slice:hover {
  filter: brightness(1.08);
  transform: scaleX(1.03);
}

.boss-filter-line {
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 13px;
}

.boss-stats-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.boss-stats-strip span {
  min-height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e5eaf0;
  font-weight: 700;
}

.boss-filter-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.pager {
  padding-top: 12px;
  color: #64748b;
  text-align: right;
}

.boss-overlay {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(15, 23, 42, 0.38);
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
}

.boss-modal {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  margin: 24px auto;
  align-self: flex-start;
  overflow: auto;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e5eaf0;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.24);
}

.boss-drawer {
  height: 100vh;
  max-width: calc(100vw - 24px);
  overflow: auto;
  background: #fff;
  border-left: 1px solid #e5eaf0;
  box-shadow: -18px 0 48px rgba(15, 23, 42, 0.2);
}

.boss-modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 58px;
  padding: 14px 18px;
  background: #fff;
  border-bottom: 1px solid #e5eaf0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.boss-modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.boss-modal-body,
.drawer-body {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.boss-modal-actions,
.drawer-foot {
  position: sticky;
  bottom: 0;
  padding: 14px 18px;
  border-top: 1px solid #e5eaf0;
  background: #fff;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.drawer-tabs {
  position: sticky;
  top: 58px;
  z-index: 1;
  padding: 12px 18px;
  border-bottom: 1px solid #e5eaf0;
  background: #f8fafc;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.drawer-tabs button {
  min-height: 32px;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  border: 1px solid #dbe3ed;
}

.drawer-tabs button.active,
.drawer-tabs button:hover {
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}

.detail-grid p,
.timeline-item {
  margin: 0;
  padding: 10px;
  border: 1px solid #e5eaf0;
  border-radius: 8px;
  background: #f8fafc;
}

.qr-box {
  width: 150px;
  height: 150px;
  border: 10px solid #111827;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #111827;
  background:
    linear-gradient(90deg, transparent 46%, #111827 46% 54%, transparent 54%),
    linear-gradient(transparent 46%, #111827 46% 54%, transparent 54%),
    #fff;
}

.phone-preview {
  width: 320px;
  max-width: 100%;
  margin: 0 auto;
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, #e0f2fe 0%, #fff 34%);
  border: 1px solid #dbeafe;
  text-align: center;
}

.preview-amount {
  margin: 12px 0;
  font-size: 42px;
  font-weight: 900;
  color: #0f172a;
}

.promo-grid,
.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.customer-tag.invalid {
  color: #64748b;
  background: #f1f5f9;
}

.loading {
  opacity: 0.72;
  pointer-events: none;
}

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

  .boss-mid-grid,
  .boss-bottom-grid {
    grid-template-columns: 1fr;
  }
}

.visual-editor {
  display: grid;
  grid-template-columns: minmax(360px, 40%) 1fr;
  gap: 18px;
  align-items: start;
}

.visual-form {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 190px);
  overflow: auto;
  padding-right: 8px;
}

.visual-form h3 {
  margin: 12px 0 0;
  font-size: 15px;
  color: #0f172a;
}

.visual-form label {
  display: grid;
  gap: 6px;
  color: #475569;
  font-size: 13px;
}

.visual-form input,
.visual-form select,
.visual-form textarea {
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  min-height: 38px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}

.visual-form textarea {
  min-height: 78px;
  resize: vertical;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 10px;
  padding: 12px 0 2px;
  background: linear-gradient(180deg, rgba(255,255,255,.2), #fff 40%);
}

.visual-preview {
  position: sticky;
  top: 18px;
  display: grid;
  place-items: center;
  min-height: calc(100vh - 170px);
  background: #eef4f2;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
}

.phone-shell {
  width: min(430px, 100%);
  height: min(760px, calc(100vh - 210px));
  min-height: 620px;
  border: 10px solid #111827;
  border-radius: 34px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 22px 50px rgba(15, 23, 42, .22);
}

.phone-shell iframe {
  border: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.material-grid {
  display: grid;
  grid-template-columns: 1fr 220px 360px;
  gap: 18px;
  align-items: start;
}

.copy-line {
  padding: 12px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #f8fafc;
  word-break: break-all;
  color: #334155;
}

.qr-real {
  display: inline-grid;
  padding: 12px;
  border: 1px solid #d8e0ea;
  border-radius: 12px;
  background: #fff;
}

.qr-real img {
  width: 180px;
  height: 180px;
  display: block;
}

#posterCanvas {
  width: 100%;
  max-width: 360px;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .12);
}

.product-summary {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 14px 0;
}

.product-cover {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #e9f8f2;
  color: var(--brand);
  font-weight: 900;
  font-size: 28px;
}

.product-cover.small {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  font-size: 20px;
}

.product-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.auth-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 56px;
  margin-top: 12px;
  color: #00865f;
  font-size: 14px;
  font-weight: 800;
}

.auth-links span {
  cursor: pointer;
}

.boss-account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.boss-account-grid button {
  border: 1px solid #d8e0ea;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  transition: .18s ease;
}

.boss-account-grid button:hover,
.boss-account-grid button.active {
  border-color: #2563eb;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .12);
  transform: translateY(-1px);
}

.boss-account-grid b,
.boss-account-grid span,
.boss-account-grid em {
  display: block;
}

.boss-account-grid span {
  margin-top: 5px;
  color: #64748b;
  font-size: 12px;
}

.boss-account-grid em {
  margin-top: 8px;
  color: #00865f;
  font-style: normal;
  font-weight: 800;
}
