/* =========================================================
   锦囊 JINNANG Console
   Warm, quiet, clinical-grade hospitality.
   ========================================================= */

:root {
  --bg: #f6f1ea;
  --bg-deep: #efe6db;
  --surface: #fffdfc;
  --surface-2: #fcf8f3;
  --surface-3: #f7efe7;
  --ink: #2d2326;
  --ink-2: #57484c;
  --muted: #8d7d80;
  --muted-2: #ae9fa0;
  --line: #eadfd5;
  --line-strong: #ddcbbd;
  --plum: #7c4a57;
  --plum-deep: #5e3340;
  --plum-dark: #44232d;
  --gold: #c9a26b;
  --gold-deep: #a97d45;
  --gold-soft: #f0e2cc;
  --sage: #6e8574;
  --sage-soft: #e9f0ea;
  --rose: #e8c9c9;
  --rose-soft: #fbeeee;
  --danger: #b04e4d;
  --danger-soft: #fbebeb;
  --warning: #b97c35;
  --warning-soft: #fdf2e2;
  --shadow-sm: 0 2px 8px rgba(72, 45, 40, 0.04);
  --shadow: 0 16px 42px rgba(72, 45, 40, 0.08);
  --shadow-lg: 0 30px 80px rgba(58, 32, 30, 0.16);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --font: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sidebar-w: 236px;
  --mobile-top: 54px;
  --mobile-bottom: 66px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--rose);
  color: var(--plum-dark);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #d9c9bd;
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #c7b3a5;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon.fill {
  fill: currentColor;
  stroke: none;
}

.serif {
  font-family: var(--serif);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold-deep);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.eyebrow.light {
  color: #d9b98e;
}

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

.tiny {
  font-size: 11px;
}

.nowrap {
  white-space: nowrap;
}

/* ---------- boot ---------- */

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: radial-gradient(circle at 50% 45%, #fffaf4 0, var(--bg) 52%, #eadfd4 100%);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.boot-screen.done {
  opacity: 0;
  visibility: hidden;
}

.boot-word {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.14em;
  color: var(--plum-dark);
}

.boot-word span {
  font-family: var(--font);
  font-size: 9px;
  letter-spacing: 0.28em;
  color: var(--gold-deep);
  margin-left: 6px;
}

.boot-line {
  width: 96px;
  height: 2px;
  overflow: hidden;
  border-radius: 99px;
  background: #e3d3c4;
}

.boot-line span {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--plum), transparent);
  animation: boot-slide 1.2s ease-in-out infinite;
}

@keyframes boot-slide {
  from { transform: translateX(-110%); }
  to { transform: translateX(360%); }
}

/* ---------- login ---------- */

.login-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(420px, 0.8fr);
  background: var(--bg);
}

.login-visual {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding: 38px 52px 34px;
  color: #f7ede1;
  background:
    radial-gradient(circle at 12% 8%, rgba(201, 162, 107, 0.24), transparent 34%),
    radial-gradient(circle at 92% 82%, rgba(201, 122, 130, 0.24), transparent 37%),
    linear-gradient(148deg, #3d1d26 0%, #5a303d 48%, #6e4150 74%, #3a1b24 100%);
}

.login-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(255, 240, 224, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 240, 224, 0.055) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(circle at 45% 48%, #000 0, transparent 72%);
  pointer-events: none;
}

.login-visual::after {
  content: "";
  position: absolute;
  width: 620px;
  height: 620px;
  right: -210px;
  top: -250px;
  border-radius: 50%;
  border: 1px solid rgba(232, 201, 181, 0.17);
  box-shadow:
    0 0 0 70px rgba(232, 201, 181, 0.035),
    0 0 0 140px rgba(232, 201, 181, 0.025);
  pointer-events: none;
}

.login-visual-glow {
  position: absolute;
  width: 460px;
  height: 460px;
  right: 8%;
  bottom: 4%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 217, 177, 0.18), transparent 66%);
  filter: blur(8px);
  pointer-events: none;
}

.login-brand {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand img {
  border-radius: 13px;
  box-shadow: 0 10px 26px rgba(20, 8, 10, 0.3);
}

.login-brand div {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.login-brand strong {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.16em;
  font-weight: 600;
}

.login-brand span {
  margin-top: 4px;
  font-size: 8px;
  letter-spacing: 0.28em;
  color: #cdb396;
}

.login-copy {
  position: relative;
  z-index: 2;
  max-width: 620px;
  margin-top: clamp(44px, 8vh, 92px);
}

.login-copy h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(38px, 4.1vw, 62px);
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: 0.02em;
}

.login-copy h1 em {
  color: #e4c396;
  font-style: normal;
  position: relative;
}

.login-copy h1 em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1px;
  background: linear-gradient(90deg, #d7b17c, transparent);
}

.login-lead {
  max-width: 480px;
  margin: 24px 0 0;
  color: rgba(247, 237, 225, 0.68);
  font-size: 14px;
  line-height: 1.95;
  letter-spacing: 0.02em;
}

.login-orbit {
  position: relative;
  z-index: 1;
  align-self: flex-end;
  width: min(42vw, 440px);
  height: min(30vw, 310px);
  margin-top: -8px;
  margin-right: -24px;
  pointer-events: none;
}

.orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(231, 203, 176, 0.18);
}

.ring-a {
  width: 300px;
  height: 300px;
  right: 40px;
  top: -50px;
}

.ring-b {
  width: 190px;
  height: 190px;
  right: 95px;
  top: 6px;
  border-style: dashed;
  border-color: rgba(231, 203, 176, 0.23);
}

.orbit-moon {
  position: absolute;
  width: 92px;
  height: 92px;
  right: 144px;
  top: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #f7e7cd, #d6ad76 70%);
  box-shadow: 0 0 70px rgba(236, 202, 156, 0.38);
}

.orbit-moon::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  left: 24px;
  top: -8px;
  border-radius: 50%;
  background: #592f3c;
}

.orbit-star {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #efd7b4;
  box-shadow: 0 0 10px #efd7b4;
}

.star-a { right: 72px; top: 18px; }
.star-b { right: 270px; top: 72px; width: 3px; height: 3px; }
.star-c { right: 112px; top: 178px; width: 3px; height: 3px; }

.float-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(247, 229, 207, 0.17);
  border-radius: 14px;
  background: rgba(255, 247, 237, 0.055);
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 38px rgba(20, 7, 10, 0.18);
}

.float-card div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.float-card strong {
  font-size: 11px;
  font-weight: 600;
  color: #fbf1e4;
}

.float-card small {
  font-size: 9px;
  color: rgba(247, 237, 225, 0.56);
  white-space: nowrap;
}

.float-icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  background: rgba(201, 162, 107, 0.17);
  color: #e3c393;
}

.float-icon .icon {
  width: 14px;
  height: 14px;
}

.float-a { right: 8px; top: 2px; }
.float-b { right: 208px; top: 144px; }
.float-c { right: 18px; bottom: 2px; }

.login-foot {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding-top: 28px;
}

.login-metrics {
  display: flex;
  gap: 42px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(240, 220, 199, 0.14);
}

.login-metrics div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.login-metrics strong {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
  color: #f0d6b1;
}

.login-metrics strong span {
  font-family: var(--font);
  font-size: 9px;
  font-weight: 400;
  margin-left: 3px;
  color: rgba(240, 214, 177, 0.62);
  letter-spacing: 0.04em;
}

.login-metrics small {
  font-size: 9px;
  color: rgba(247, 237, 225, 0.42);
  letter-spacing: 0.1em;
}

.login-quote {
  max-width: 530px;
  margin: 16px 0 0;
  color: rgba(247, 237, 225, 0.4);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.05em;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 40px 46px;
  background:
    radial-gradient(circle at 92% 8%, rgba(201, 162, 107, 0.12), transparent 25%),
    radial-gradient(circle at 0% 100%, rgba(232, 201, 201, 0.26), transparent 30%),
    var(--bg);
  position: relative;
}

.login-panel::before {
  content: "玥";
  position: absolute;
  right: -30px;
  bottom: -70px;
  font-family: var(--serif);
  font-size: 280px;
  line-height: 1;
  color: rgba(124, 74, 87, 0.035);
  pointer-events: none;
}

.login-panel-inner {
  width: 100%;
  max-width: 404px;
  position: relative;
  z-index: 2;
  animation: rise-in 0.6s cubic-bezier(0.22, 0.8, 0.36, 1) both;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-mobile-brand {
  display: none;
}

.login-panel h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--plum-dark);
}

.login-sub {
  margin: 9px 0 30px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.field {
  display: block;
  margin-bottom: 17px;
}

.field > span {
  display: block;
  margin-bottom: 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.06em;
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 253, 252, 0.72);
  color: var(--muted);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.input-wrap:focus-within {
  border-color: var(--plum);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(124, 74, 87, 0.08);
}

.input-wrap input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.input-wrap input::placeholder {
  color: #b7a8a4;
}

.ghost-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.ghost-icon:hover {
  background: rgba(124, 74, 87, 0.08);
  color: var(--plum);
}

.form-error {
  margin: -4px 0 13px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.18s, border-color 0.18s, color 0.18s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, #875461, #683a47 72%);
  color: #fff9f2;
  box-shadow: 0 10px 22px rgba(94, 51, 64, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #925d6a, #713f4d 72%);
  box-shadow: 0 14px 28px rgba(94, 51, 64, 0.25);
}

.btn-soft {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--plum);
}

.btn-soft:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.btn-ghost {
  border-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  background: rgba(124, 74, 87, 0.06);
  color: var(--plum);
}

.btn-gold {
  background: linear-gradient(135deg, #d7b783, #bd9157);
  color: #3c2518;
  box-shadow: 0 8px 20px rgba(169, 125, 69, 0.2);
}

.btn-danger {
  border-color: #f0d5d4;
  background: var(--danger-soft);
  color: var(--danger);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  height: 50px;
  border-radius: 13px;
  font-size: 13.5px;
  letter-spacing: 0.04em;
}

.btn-sm {
  height: 32px;
  padding: 0 11px;
  border-radius: 9px;
  font-size: 11.5px;
}

.btn-xs {
  height: 27px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 10.5px;
}

.btn-icon {
  width: 34px;
  padding: 0;
}

.demo-accounts {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.demo-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.demo-title span {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
}

.demo-title small {
  font-size: 9px;
  color: var(--muted-2);
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.demo-account {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 252, 0.65);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.15s;
}

.demo-account:hover {
  border-color: var(--line-strong);
  background: #fff;
  transform: translateY(-1px);
}

.demo-account > span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.demo-account strong {
  font-size: 11px;
  color: var(--ink);
}

.demo-account small {
  font-size: 8.5px;
  color: var(--muted);
  white-space: nowrap;
}

.demo-hint {
  margin: 10px 0 0;
  color: var(--muted-2);
  font-size: 9.5px;
  text-align: center;
}

.demo-hint code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #f1e7dc;
  color: var(--plum);
  font-size: 9px;
}

.login-legal {
  margin: 22px 0 0;
  color: #ad9d9d;
  font-size: 9.5px;
  line-height: 1.7;
  text-align: center;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--plum);
  font-size: 15px;
}

/* ---------- app shell ---------- */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

.sidebar {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 24px 15px 16px;
  overflow: hidden;
  color: #f7ece0;
  background:
    radial-gradient(circle at 30% -10%, rgba(216, 173, 128, 0.24), transparent 33%),
    radial-gradient(circle at 100% 80%, rgba(201, 123, 132, 0.18), transparent 42%),
    linear-gradient(172deg, #40212b 0%, #4e2a36 52%, #371b24 100%);
}

.sidebar::before {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  left: -140px;
  bottom: 70px;
  border-radius: 50%;
  border: 1px solid rgba(236, 207, 177, 0.09);
  box-shadow: 0 0 0 40px rgba(236, 207, 177, 0.025), 0 0 0 80px rgba(236, 207, 177, 0.015);
  pointer-events: none;
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 7px;
}

.brand img {
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(12, 4, 8, 0.32);
}

.brand-word {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-word strong {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.15em;
}

.brand-word small {
  margin-top: 3px;
  color: #b8987d;
  font-size: 7px;
  letter-spacing: 0.29em;
}

.workspace-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 21px 2px 16px;
  padding: 10px 11px;
  border: 1px solid rgba(241, 220, 198, 0.11);
  border-radius: 12px;
  background: rgba(255, 248, 238, 0.05);
}

.workspace-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: #a9c7ac;
  box-shadow: 0 0 0 4px rgba(169, 199, 172, 0.1);
}

.workspace-pill div {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.workspace-pill strong {
  overflow: hidden;
  color: #f4e7d9;
  font-size: 10.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-pill small {
  color: rgba(244, 231, 217, 0.45);
  font-size: 8.5px;
}

.workspace-chevron {
  color: rgba(244, 231, 217, 0.35);
}

.workspace-chevron .icon {
  width: 13px;
  height: 13px;
}

.side-nav {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 10px;
}

.side-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
}

.side-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 39px;
  padding: 0 11px;
  border-radius: 10px;
  color: rgba(248, 235, 222, 0.57);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: background 0.18s, color 0.18s;
}

.side-nav a .icon {
  width: 17px;
  height: 17px;
  opacity: 0.8;
}

.side-nav a:hover {
  background: rgba(255, 246, 235, 0.055);
  color: rgba(255, 247, 236, 0.88);
}

.side-nav a.active {
  background: linear-gradient(90deg, rgba(218, 181, 138, 0.17), rgba(218, 181, 138, 0.045));
  color: #f8e9d6;
  font-weight: 600;
}

.side-nav a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 2px;
  background: #dfbe8e;
}

.side-nav a.active .icon {
  opacity: 1;
  color: #e5c596;
}

.nav-badge {
  margin-left: auto;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 99px;
  background: #d6b078;
  color: #3d2024;
  font-size: 9px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}

.nav-divider {
  margin: 13px 11px 5px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(248, 235, 222, 0.25);
  font-size: 8px;
  letter-spacing: 0.14em;
}

.nav-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(248, 235, 222, 0.08);
}

.nav-live {
  width: 5px;
  height: 5px;
  margin-left: auto;
  border-radius: 50%;
  background: #9fbe9f;
  box-shadow: 0 0 0 3px rgba(159, 190, 159, 0.1);
}

.sidebar-bottom {
  position: relative;
  margin-top: auto;
  padding-top: 10px;
}

.shift-card {
  margin: 0 2px 10px;
  padding: 12px;
  border: 1px solid rgba(241, 220, 198, 0.1);
  border-radius: 13px;
  background: linear-gradient(150deg, rgba(255, 248, 238, 0.07), rgba(255, 248, 238, 0.02));
}

.shift-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  color: rgba(247, 236, 224, 0.75);
}

.shift-head b {
  margin-left: auto;
  color: rgba(247, 236, 224, 0.34);
  font-size: 8px;
  font-weight: 400;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a9c7ac;
  box-shadow: 0 0 0 3px rgba(169, 199, 172, 0.11);
  animation: live-pulse 2.4s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(169, 199, 172, 0.1); }
  50% { box-shadow: 0 0 0 5px rgba(169, 199, 172, 0.04); }
}

.shift-card p {
  margin: 7px 0 9px;
  color: rgba(247, 236, 224, 0.38);
  font-size: 9px;
}

.shift-card p strong {
  color: #e5c596;
  font-weight: 600;
}

.shift-meter {
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.shift-meter span {
  display: block;
  height: 100%;
  width: 64%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b88b58, #e3c18e);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: rgba(248, 235, 222, 0.75);
  text-align: left;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}

.user-chip:hover {
  border-color: rgba(241, 220, 198, 0.1);
  background: rgba(255, 248, 238, 0.05);
}

.user-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.user-meta strong {
  font-size: 10.5px;
  font-weight: 600;
  color: #f5e8d9;
}

.user-meta small {
  color: rgba(245, 232, 217, 0.37);
  font-size: 8.5px;
}

.user-chip > .icon {
  width: 15px;
  height: 15px;
  color: rgba(245, 232, 217, 0.3);
}

/* ---------- avatars ---------- */

.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fffaf4;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.3), transparent 40%),
    var(--avatar, var(--plum));
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.avatar-sm {
  width: 31px;
  height: 31px;
  font-size: 11px;
}

.avatar-lg {
  width: 52px;
  height: 52px;
  font-size: 19px;
}

.avatar-xl {
  width: 64px;
  height: 64px;
  font-size: 23px;
}

/* ---------- page chrome ---------- */

.page {
  height: 100dvh;
  overflow-y: auto;
  padding: 26px 30px 50px;
  outline: none;
}

.page.inbox-page {
  height: 100dvh;
  padding: 16px;
  overflow: hidden;
}

.mobile-topbar,
.mobile-nav {
  display: none;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-head-copy {
  min-width: 0;
}

.page-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(26px, 2.6vw, 34px);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--plum-dark);
}

.page-head h1 em {
  font-style: normal;
  color: var(--gold-deep);
}

.page-head .sub {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.page-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

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

.section-title h2,
.section-title h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

.section-title small {
  color: var(--muted);
  font-size: 10px;
}

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

.card-pad {
  padding: 20px;
}

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

.card-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}

.card-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 23px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
}

.chip .icon {
  width: 11px;
  height: 11px;
}

.chip-gold {
  border-color: #ecd9ba;
  background: #fdf7eb;
  color: var(--gold-deep);
}

.chip-rose {
  border-color: #f0d7d5;
  background: var(--rose-soft);
  color: var(--plum);
}

.chip-sage {
  border-color: #d7e4d9;
  background: var(--sage-soft);
  color: #4c6c56;
}

.chip-danger {
  border-color: #f0d3d2;
  background: var(--danger-soft);
  color: var(--danger);
}

.chip-warn {
  border-color: #f1dfc1;
  background: var(--warning-soft);
  color: var(--warning);
}

.chip-muted {
  background: #f5f0ea;
  color: var(--muted);
}

.badge-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 8px;
  border-radius: 6px;
  background: #f6efe7;
  color: #88736d;
  font-size: 9px;
  white-space: nowrap;
}

.tag.plum {
  background: #f6ebec;
  color: var(--plum);
}

.tag.sage {
  background: var(--sage-soft);
  color: #55715e;
}

.tag.warn {
  background: var(--warning-soft);
  color: var(--warning);
}

.tag.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.divider {
  height: 1px;
  background: var(--line);
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 220px;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.empty-state .empty-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: var(--surface-3);
  color: var(--plum);
}

.empty-state h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-2);
}

.empty-state p {
  max-width: 320px;
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.skeleton {
  border-radius: 8px;
  background: linear-gradient(100deg, #f1e9e1 25%, #faf5ef 42%, #f1e9e1 58%);
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

/* ---------- dashboard ---------- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 16px;
  padding: 23px 26px;
  overflow: hidden;
  border: 1px solid #e9d7c5;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 92% 8%, rgba(201, 162, 107, 0.18), transparent 26%),
    radial-gradient(circle at 6% 100%, rgba(232, 201, 201, 0.3), transparent 30%),
    linear-gradient(110deg, #fffaf3, #fbf1e5 75%);
  box-shadow: var(--shadow-sm);
}

.hero::after {
  content: "玥";
  position: absolute;
  right: 72px;
  top: -28px;
  font-family: var(--serif);
  font-size: 130px;
  color: rgba(124, 74, 87, 0.045);
  transform: rotate(-7deg);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-copy h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.hero-copy h2 strong {
  color: var(--plum);
  font-weight: 600;
}

.hero-copy p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11.5px;
}

.hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-orb {
  position: absolute;
  right: 230px;
  top: -45px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  border: 1px solid rgba(124, 74, 87, 0.09);
  box-shadow: 0 0 0 28px rgba(124, 74, 87, 0.025), 0 0 0 56px rgba(124, 74, 87, 0.016);
  pointer-events: none;
}

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

.kpi {
  position: relative;
  padding: 16px 17px 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

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

.kpi-label {
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.kpi-icon {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 9px;
  background: var(--kpi-soft, #f6ece5);
  color: var(--kpi-color, var(--plum));
}

.kpi-icon .icon {
  width: 14px;
  height: 14px;
}

.kpi-value {
  margin-top: 9px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
  line-height: 1.05;
  color: var(--ink);
}

.kpi-value small {
  margin-left: 3px;
  font-family: var(--font);
  font-size: 10px;
  color: var(--muted);
}

.kpi-foot {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 9px;
}

.kpi-foot strong {
  color: var(--kpi-color, var(--plum));
  font-weight: 600;
}

.kpi-spark {
  position: absolute;
  right: 10px;
  bottom: 12px;
  width: 54px;
  height: 22px;
  opacity: 0.45;
}

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

.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-9 { grid-column: span 9; }
.span-12 { grid-column: span 12; }

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

.chart-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}

.chart-card .chart-sub {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9.5px;
}

.chart-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 9px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--legend, var(--plum));
}

.line-chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.grid-line {
  stroke: #eee3d9;
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.axis-label {
  fill: #a59693;
  font-size: 8.5px;
  font-family: var(--font);
}

.chart-area {
  fill: url(#areaGradient);
}

.chart-line {
  fill: none;
  stroke: var(--plum);
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line.secondary {
  stroke: var(--gold);
  stroke-width: 1.7;
  stroke-dasharray: 4 4;
}

.chart-dot {
  fill: #fff;
  stroke: var(--plum);
  stroke-width: 2;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--plum-dark);
  color: #fff8ee;
  font-size: 9px;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}

.chart-wrap {
  position: relative;
}

.donut-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-top: 8px;
}

.donut {
  position: relative;
  width: 124px;
  height: 124px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(var(--segments));
  box-shadow: inset 0 0 0 1px rgba(124, 74, 87, 0.04);
}

.donut::after {
  content: "";
  position: absolute;
  inset: 23px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.donut-center {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}

.donut-center strong {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
}

.donut-center small {
  color: var(--muted);
  font-size: 8px;
}

.donut-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.donut-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  color: var(--muted);
}

.donut-item .legend-dot {
  flex: none;
}

.donut-item strong {
  margin-left: auto;
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 600;
}

.follow-list,
.hot-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.follow-item,
.hot-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 4px;
  border-bottom: 1px solid #f3ebe3;
  border-radius: 8px;
  transition: background 0.16s;
}

.follow-item:last-child,
.hot-item:last-child {
  border-bottom: none;
}

.follow-item:hover,
.hot-item:hover {
  background: var(--surface-2);
}

.follow-main,
.hot-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.follow-main strong,
.hot-main strong {
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.follow-main span,
.hot-main span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.follow-time {
  flex: none;
  color: var(--muted);
  font-size: 8.5px;
  text-align: right;
}

.follow-time.overdue {
  color: var(--danger);
}

.score-pill {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #fbf1e4;
  color: var(--gold-deep);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
}

.mini-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--plum);
  font-size: 9.5px;
  font-weight: 600;
}

.mini-link .icon {
  width: 11px;
  height: 11px;
}

.ai-panel {
  position: relative;
  overflow: hidden;
  padding: 19px 20px;
  color: #f6e8d7;
  background:
    radial-gradient(circle at 90% 0%, rgba(215, 174, 119, 0.22), transparent 38%),
    linear-gradient(145deg, #4a2632, #603744 65%, #3d1e28);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 38px rgba(69, 34, 43, 0.17);
}

.ai-panel::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  right: -62px;
  bottom: -88px;
  border-radius: 50%;
  border: 1px solid rgba(240, 210, 173, 0.16);
  box-shadow: 0 0 0 26px rgba(240, 210, 173, 0.04);
}

.ai-panel-head {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #e7c99f;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.ai-panel h3 {
  position: relative;
  z-index: 1;
  margin: 10px 0 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.35;
}

.ai-panel p {
  position: relative;
  z-index: 1;
  margin: 7px 0 14px;
  color: rgba(247, 235, 220, 0.52);
  font-size: 10px;
  line-height: 1.7;
}

.ai-stats {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(240, 210, 173, 0.14);
}

.ai-stats div {
  display: flex;
  flex-direction: column;
}

.ai-stats strong {
  color: #f0d4aa;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
}

.ai-stats small {
  color: rgba(247, 235, 220, 0.35);
  font-size: 8px;
}

.channel-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 10px;
}

.channel-bar-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
}

.channel-bar-head strong {
  margin-left: auto;
  font-size: 9.5px;
}

.channel-bar {
  height: 5px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: #f3ebe4;
}

.channel-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--bar, var(--plum));
  opacity: 0.82;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-2);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}

.quick-action:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.quick-action .icon {
  width: 14px;
  height: 14px;
  color: var(--plum);
}

/* ---------- inbox ---------- */

.inbox-shell {
  position: relative;
  display: grid;
  grid-template-columns: 326px minmax(360px, 1fr) 340px;
  height: calc(100dvh - 32px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(73, 44, 39, 0.08);
}

.conv-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: #fdfaf6;
}

.conv-head {
  padding: 18px 17px 8px;
}

.conv-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.conv-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.conv-head h2 span {
  margin-left: 5px;
  color: var(--muted);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 400;
}

.conv-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  margin-top: 11px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted-2);
}

.conv-search:focus-within {
  border-color: #d7bfb5;
  box-shadow: 0 0 0 3px rgba(124, 74, 87, 0.05);
}

.conv-search .icon {
  width: 14px;
  height: 14px;
}

.conv-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 11px;
}

.conv-tabs {
  display: flex;
  gap: 3px;
  padding: 10px 13px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.conv-tabs::-webkit-scrollbar {
  display: none;
}

.conv-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: none;
  height: 27px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
  transition: all 0.16s;
}

.conv-tab .icon {
  width: 12px;
  height: 12px;
}

.conv-tab:hover {
  background: #f6ede6;
}

.conv-tab.active {
  border-color: #e6d2c6;
  background: #fff;
  color: var(--plum);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.conv-tab b {
  margin-left: 3px;
  font-size: 8.5px;
  font-weight: 600;
}

.conv-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 7px 10px;
}

.conv-item {
  position: relative;
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr) auto;
  gap: 9px;
  padding: 11px 9px 11px 10px;
  border-left: 2px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s;
}

.conv-item:hover {
  background: #f8f0e9;
}

.conv-item.active {
  border-left-color: var(--plum);
  background: #f7ece8;
}

.conv-item + .conv-item {
  margin-top: 1px;
}

.conv-avatar-wrap {
  position: relative;
}

.conv-online {
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 8px;
  height: 8px;
  border: 2px solid #fdfaf6;
  border-radius: 50%;
  background: #82a18a;
}

.conv-main {
  min-width: 0;
}

.conv-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.conv-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-mark-xs {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  flex: none;
  border-radius: 4px;
  color: #fff;
  background: var(--cm, var(--plum));
  font-size: 7px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.channel-mark-xs.light {
  color: #3a2a17;
}

.conv-preview {
  display: -webkit-box;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.conv-preview.typing {
  color: var(--sage);
}

.conv-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  min-width: 42px;
}

.conv-time {
  color: var(--muted-2);
  font-size: 8px;
  white-space: nowrap;
}

.unread-count {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--plum);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
}

.needs-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c97a83;
  box-shadow: 0 0 0 3px rgba(201, 122, 131, 0.11);
}

.conv-tags {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 5px;
  overflow: hidden;
}

.conv-tags .tag {
  height: 17px;
  padding: 0 5px;
  font-size: 7.5px;
}

.conv-assignee {
  color: var(--muted-2);
  font-size: 8px;
}

.conv-empty {
  padding: 40px 20px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background:
    radial-gradient(circle at 90% 0%, rgba(240, 226, 204, 0.27), transparent 27%),
    #fbf6f0;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 10px 16px;
  border-bottom: 1px solid #ebe0d6;
  background: rgba(255, 252, 248, 0.82);
  backdrop-filter: blur(10px);
}

.chat-back {
  display: none;
}

.chat-person {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.chat-person-main {
  min-width: 0;
}

.chat-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.chat-name-row h2 {
  overflow: hidden;
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
}

.chat-sub .chip {
  height: 18px;
  padding: 0 6px;
  font-size: 8px;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
}

.chat-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 9.5px;
  cursor: pointer;
  transition: background 0.16s, color 0.16s;
}

.chat-action:hover {
  background: #f1e6dd;
  color: var(--plum);
}

.chat-action .icon {
  width: 14px;
  height: 14px;
}

.chat-action.danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px 14px;
}

.chat-notice {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0 22px 0;
  padding: 8px 10px;
  border: 1px solid #eadbc8;
  border-radius: 9px;
  background: #fffaf1;
  color: #9a7c58;
  font-size: 8.5px;
  line-height: 1.6;
}

.chat-notice .icon {
  width: 12px;
  height: 12px;
  margin-top: 1px;
  flex: none;
}

.date-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  color: #b1a29f;
  font-size: 8px;
}

.date-divider::before,
.date-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #ede2d8;
}

.message {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  margin: 0 0 12px;
  animation: message-in 0.2s ease both;
}

@keyframes message-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.customer {
  justify-content: flex-start;
}

.message.agent {
  justify-content: flex-end;
}

.message.ai {
  justify-content: flex-start;
}

.message.system {
  justify-content: center;
}

.message-avatar {
  width: 27px;
  height: 27px;
  font-size: 9px;
}

.msg-body {
  max-width: min(74%, 560px);
}

.message.agent .msg-body {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.msg-bubble {
  padding: 10px 13px;
  border: 1px solid #ede1d5;
  border-radius: 4px 15px 15px 15px;
  background: #fff;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 3px 10px rgba(80, 50, 40, 0.035);
}

.message.agent .msg-bubble {
  border-color: transparent;
  border-radius: 15px 4px 15px 15px;
  background: linear-gradient(150deg, #80505d, #6a3d49);
  color: #fff9f1;
  box-shadow: 0 6px 18px rgba(94, 51, 64, 0.14);
}

.message.ai .msg-bubble {
  border-color: #dfe9df;
  border-radius: 4px 15px 15px 15px;
  background: #f2f7f1;
  color: #415048;
}

.ai-bubble-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 4px;
  color: #6b856f;
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.ai-bubble-label .icon {
  width: 10px;
  height: 10px;
}

.msg-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  color: #b1a29f;
  font-size: 7.5px;
}

.msg-meta .delivery {
  padding: 1px 4px;
  border-radius: 3px;
  background: #f4ece4;
  color: #9d8b84;
}

.msg-meta .delivery.failed {
  background: var(--danger-soft);
  color: var(--danger);
}

.system-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 99px;
  background: rgba(244, 235, 225, 0.82);
  color: #9f8c80;
  font-size: 8px;
  text-align: center;
}

.system-note .icon {
  width: 10px;
  height: 10px;
}

.chat-composer {
  position: relative;
  padding: 9px 17px 13px;
  border-top: 1px solid #ebe0d6;
  background: rgba(255, 252, 248, 0.92);
  backdrop-filter: blur(10px);
}

.composer-box {
  border: 1px solid #e3d4c8;
  border-radius: 13px;
  background: #fff;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.composer-box:focus-within {
  border-color: #c9a9a3;
  box-shadow: 0 0 0 3px rgba(124, 74, 87, 0.05);
}

.composer-box textarea {
  display: block;
  width: 100%;
  height: 54px;
  max-height: 130px;
  padding: 10px 12px 3px;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  font-size: 12px;
  line-height: 1.65;
}

.composer-box textarea::placeholder {
  color: #bbaaa5;
}

.composer-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px 6px;
}

.composer-tool {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 25px;
  padding: 0 6px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 8.5px;
  cursor: pointer;
}

.composer-tool:hover {
  background: #f7efe7;
  color: var(--plum);
}

.composer-tool .icon {
  width: 12px;
  height: 12px;
}

.composer-send {
  display: grid;
  place-items: center;
  width: 31px;
  height: 28px;
  margin-left: auto;
  border: none;
  border-radius: 8px;
  background: var(--plum);
  color: #fff;
  cursor: pointer;
  transition: background 0.16s, transform 0.14s;
}

.composer-send:hover {
  background: var(--plum-deep);
  transform: translateY(-1px);
}

.composer-send:disabled {
  opacity: 0.45;
  transform: none;
}

.composer-send .icon {
  width: 14px;
  height: 14px;
}

.composer-hint {
  margin: 6px 2px 0;
  color: #b8a8a3;
  font-size: 7.5px;
  text-align: center;
}

.quick-pop,
.ai-pop {
  position: absolute;
  left: 17px;
  right: 17px;
  bottom: calc(100% - 4px);
  z-index: 12;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(58, 33, 31, 0.16);
  animation: pop-in 0.16s ease both;
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(4px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.quick-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.quick-list {
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
}

.quick-item {
  display: block;
  width: 100%;
  padding: 8px 9px;
  border: none;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.quick-item:hover {
  background: var(--surface-3);
}

.quick-item strong {
  display: block;
  font-size: 9.5px;
  color: var(--ink-2);
}

.quick-item span {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: var(--muted);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-empty {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 30px;
  text-align: center;
}

.chat-empty-inner {
  max-width: 280px;
}

.chat-empty-moon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(145deg, #f3e2cc, #e3c9a7);
  color: var(--plum);
  box-shadow: 0 12px 28px rgba(169, 125, 69, 0.16);
}

.chat-empty-moon .icon {
  width: 28px;
  height: 28px;
}

.chat-empty h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
}

.chat-empty p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

/* ---------- profile panel ---------- */

.profile-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--line);
  background: #fffdfb;
}

.profile-tabs {
  display: flex;
  gap: 0;
  flex: none;
  border-bottom: 1px solid var(--line);
}

.profile-tab {
  flex: 1;
  height: 45px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.profile-tab.active {
  border-bottom-color: var(--plum);
  color: var(--plum);
  font-weight: 600;
}

.profile-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 16px 24px;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 0 13px;
}

.profile-identity h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
}

.profile-identity p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.profile-actions {
  display: flex;
  gap: 5px;
  margin-left: auto;
}

.score-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 13px;
  padding: 12px;
  border: 1px solid #eadbc8;
  border-radius: 13px;
  background: linear-gradient(135deg, #fffaf2, #fcf3e6);
}

.score-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--score) * 1%), #ecdfce 0);
}

.score-ring::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #fffaf3;
}

.score-ring strong {
  position: relative;
  z-index: 1;
  font-family: var(--serif);
  font-size: 16px;
  color: var(--gold-deep);
}

.score-copy {
  min-width: 0;
}

.score-copy strong {
  display: block;
  font-size: 10px;
  color: var(--ink-2);
}

.score-copy span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.5;
}

.profile-section {
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid #f0e6dc;
}

.profile-section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.profile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.profile-section-head h4 {
  margin: 0;
  color: var(--ink-2);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
}

.profile-section-head button {
  border: none;
  background: transparent;
  color: var(--plum);
  font-size: 8.5px;
  cursor: pointer;
}

.fact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}

.fact {
  min-width: 0;
}

.fact label {
  display: block;
  color: var(--muted-2);
  font-size: 7.5px;
  letter-spacing: 0.04em;
}

.fact strong {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--ink-2);
  font-size: 10px;
  cursor: pointer;
}

.copy-value .icon {
  width: 10px;
  height: 10px;
  color: var(--muted-2);
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}

.stage-select {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-2);
  font-size: 9.5px;
  outline: none;
}

.stage-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 7px;
}

.followup-item {
  display: flex;
  gap: 7px;
  padding: 7px 0;
  border-bottom: 1px solid #f4ece5;
}

.followup-item:last-child {
  border-bottom: none;
}

.followup-check {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 1px;
  border: 1px solid #d9c9bd;
  border-radius: 50%;
  background: #fff;
  color: transparent;
  cursor: pointer;
}

.followup-check:hover {
  border-color: var(--sage);
  color: var(--sage);
}

.followup-check .icon {
  width: 9px;
  height: 9px;
}

.followup-main {
  min-width: 0;
}

.followup-main p {
  margin: 0;
  color: var(--ink-2);
  font-size: 9px;
  line-height: 1.55;
}

.followup-main small {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 7.5px;
}

.followup-main small.overdue {
  color: var(--danger);
}

.ai-copilot-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 11px;
  padding: 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f5ece0, #fbf5ea);
  color: var(--gold-deep);
  font-size: 9px;
  font-weight: 600;
}

.ai-copilot-head .icon {
  width: 14px;
  height: 14px;
}

.ai-summary {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 9px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.ai-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.ai-suggestion {
  margin-top: 11px;
  padding: 11px;
  border: 1px solid #dfe9df;
  border-radius: 11px;
  background: #f5faf4;
}

.ai-suggestion-head {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
  color: #5c7862;
  font-size: 8.5px;
  font-weight: 600;
}

.ai-suggestion p {
  margin: 0;
  color: #3f5045;
  font-size: 9.5px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.ai-suggestion-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.confidence {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 7.5px;
}

.confidence-bar {
  flex: 1;
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: #e6ded5;
}

.confidence-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--sage);
}

.source-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.source-item {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 7.5px;
}

.source-item strong {
  margin-left: auto;
  color: var(--ink-2);
  font-weight: 500;
}

.ai-note {
  margin-top: 7px;
  color: var(--muted-2);
  font-size: 7.5px;
  line-height: 1.6;
}

/* ---------- tables & filters ---------- */

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 13px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  min-width: 210px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted-2);
}

.search-box:focus-within {
  border-color: #d7bfb5;
  box-shadow: 0 0 0 3px rgba(124, 74, 87, 0.05);
}

.search-box .icon {
  width: 14px;
  height: 14px;
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 10.5px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: #fff;
  color: var(--muted);
  font-size: 9.5px;
  cursor: pointer;
}

.filter-chip .icon {
  width: 11px;
  height: 11px;
}

.filter-chip:hover,
.filter-chip.active {
  border-color: #dbc6b8;
  background: #fbf1e9;
  color: var(--plum);
}

.filter-chip.active {
  font-weight: 600;
}

select.filter-select {
  height: 32px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-2);
  font-size: 9.5px;
  outline: none;
}

.table-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

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

.data-table th {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: #fcf7f1;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #f4ece4;
  color: var(--ink-2);
  font-size: 10px;
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr {
  transition: background 0.14s;
}

.data-table tbody tr:hover {
  background: #fdf8f2;
}

.data-table .strong {
  color: var(--ink);
  font-weight: 600;
}

.cell-person {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
}

.cell-person-main {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.cell-person-main strong {
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 600;
}

.cell-person-main small {
  color: var(--muted-2);
  font-size: 8px;
}

.cell-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

/* ---------- customers ---------- */

.customer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 10px;
}

.customer-card {
  position: relative;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
  transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
}

.customer-card:hover {
  transform: translateY(-2px);
  border-color: #dfcbbd;
  box-shadow: 0 12px 28px rgba(74, 46, 40, 0.07);
}

.customer-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.customer-card-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
}

.customer-card-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 8.5px;
}

.customer-card-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid #f2e9e1;
}

.customer-card-foot {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
}

.customer-card-foot .mini-link {
  margin-left: auto;
}

/* ---------- kanban ---------- */

.kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(226px, 1fr);
  gap: 10px;
  height: calc(100dvh - 168px);
  overflow-x: auto;
  padding-bottom: 10px;
}

.kanban-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #faf5ef;
}

.kanban-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 11px 11px 8px;
  border-bottom: 1px solid #f0e6dc;
}

.kanban-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--stage-color, var(--plum));
}

.kanban-head h3 {
  margin: 0;
  font-size: 9.5px;
  font-weight: 600;
}

.kanban-count {
  margin-left: auto;
  display: grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: #efe5da;
  color: var(--muted);
  font-size: 8px;
}

.kanban-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px;
}

.kanban-list.drag-over {
  background: #f5eae1;
}

.lead-card {
  margin-bottom: 6px;
  padding: 10px;
  border: 1px solid #eee2d7;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(80, 50, 40, 0.03);
  cursor: grab;
  transition: border-color 0.16s, box-shadow 0.16s, transform 0.16s;
}

.lead-card:hover {
  border-color: #ddc8b8;
  box-shadow: 0 7px 16px rgba(74, 46, 40, 0.07);
}

.lead-card:active {
  cursor: grabbing;
}

.lead-card.dragging {
  opacity: 0.45;
}

.lead-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lead-card-head strong {
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-card-head .score-pill {
  width: 27px;
  height: 27px;
  margin-left: auto;
  border-radius: 8px;
  font-size: 11px;
}

.lead-card p {
  display: -webkit-box;
  margin: 6px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.lead-card-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 6px;
}

.lead-card-facts .tag {
  height: 17px;
  padding: 0 5px;
  font-size: 7.5px;
}

.lead-card-foot {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid #f5ece4;
  color: var(--muted-2);
  font-size: 7.5px;
}

.lead-card-foot .avatar {
  width: 17px;
  height: 17px;
  font-size: 7px;
}

.lead-card-foot button {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--plum);
  font-size: 7.5px;
  cursor: pointer;
}

.lead-move {
  width: 100%;
  height: 24px;
  margin-top: 6px;
  padding: 0 5px;
  border: 1px solid #eee2d7;
  border-radius: 6px;
  background: #fdf9f4;
  color: var(--muted);
  font-size: 7.5px;
  outline: none;
  cursor: pointer;
}

.lead-move:focus {
  border-color: #d9c4b5;
}

.kanban-empty {
  padding: 20px 8px;
  color: var(--muted-2);
  font-size: 8.5px;
  text-align: center;
}

/* ---------- nationwide stores ---------- */

.store-kpis .kpi {
  background: linear-gradient(145deg, #fffdfb, #fcf7f1);
}

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

.store-card {
  position: relative;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color 0.16s, box-shadow 0.16s, transform 0.16s;
}

.store-card:hover {
  border-color: #dcc6b7;
  box-shadow: 0 12px 28px rgba(74, 46, 40, 0.07);
  transform: translateY(-2px);
}

.store-card.store-inactive {
  opacity: 0.62;
  background: #faf6f1;
}

.store-card-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.store-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 11px;
  color: var(--gold-deep);
  background: linear-gradient(145deg, #f5e6d0, #fbf4e8);
}

.store-mark .icon {
  width: 17px;
  height: 17px;
}

.store-card-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.store-card-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 8.5px;
}

.store-card-head .chip {
  height: 19px;
  padding: 0 6px;
  font-size: 7.5px;
}

.store-facts {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 7px;
  margin-top: 11px;
  padding: 9px 0;
  border-top: 1px solid #f3eae2;
  border-bottom: 1px solid #f3eae2;
}

.store-facts > div {
  min-width: 0;
}

.store-facts label {
  display: block;
  color: var(--muted-2);
  font-size: 7px;
}

.store-facts strong {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: var(--ink-2);
  font-size: 9px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-facts small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-capacity {
  margin-top: 9px;
}

.store-capacity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 7.5px;
}

.store-capacity-head strong {
  color: var(--ink-2);
  font-size: 8px;
  font-weight: 600;
}

.store-track {
  height: 4px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: #f1e8df;
}

.store-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.store-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid #f3eae2;
}

.store-stats div {
  display: flex;
  flex-direction: column;
}

.store-stats strong {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  color: var(--plum);
}

.store-stats small {
  color: var(--muted);
  font-size: 7px;
}

.store-card-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid #f5ede6;
}

.store-card-foot > span {
  flex: 1;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 7.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-card-foot button {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: none;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--plum);
  font-size: 7.5px;
  cursor: pointer;
}

.store-card-foot button .icon {
  width: 10px;
  height: 10px;
}

@media (max-width: 1200px) {
  .store-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .store-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- channels ---------- */

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

.channel-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.channel-card::after {
  content: "";
  position: absolute;
  right: -38px;
  top: -38px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--ch-soft, #f8efe7);
  opacity: 0.65;
}

.channel-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.channel-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 13px;
  background: var(--ch, var(--plum));
  color: #fff;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--ch) 24%, transparent);
}

.channel-mark.light {
  color: #3a2a17;
}

.channel-title {
  min-width: 0;
}

.channel-title h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
}

.channel-title p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 8.5px;
}

.channel-status {
  margin-left: auto;
  align-self: flex-start;
}

.channel-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 15px 0 13px;
  padding: 10px 0;
  border-top: 1px solid #f3eae2;
  border-bottom: 1px solid #f3eae2;
}

.channel-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.channel-stat strong {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
}

.channel-stat small {
  color: var(--muted);
  font-size: 7.5px;
}

.channel-endpoint {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 7.5px;
  overflow: hidden;
}

.channel-endpoint span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-endpoint button {
  margin-left: auto;
  flex: none;
  border: none;
  background: transparent;
  color: var(--plum);
  font-size: 7.5px;
  cursor: pointer;
}

.channel-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 5px;
  margin-top: 11px;
}

.integration-guide {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.guide-step {
  position: relative;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.guide-step b {
  display: inline-grid;
  place-items: center;
  width: 21px;
  height: 21px;
  margin-bottom: 7px;
  border-radius: 7px;
  background: var(--gold-soft);
  color: var(--gold-deep);
  font-family: var(--serif);
  font-size: 11px;
}

.guide-step h4 {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
}

.guide-step p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.7;
}

/* ---------- knowledge ---------- */

.knowledge-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 14px;
  align-items: start;
}

.knowledge-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 9px;
}

.knowledge-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  transition: border-color 0.16s, box-shadow 0.16s;
}

.knowledge-card:hover {
  border-color: #ddc9ba;
  box-shadow: var(--shadow-sm);
}

.knowledge-card-head {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.knowledge-card-head h3 {
  flex: 1;
  margin: 0;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.5;
}

.knowledge-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  padding: 3px 5px 3px 3px;
  border: 1px solid #eadfd5;
  border-radius: 99px;
  background: #f8f3ed;
  color: var(--muted);
  font-size: 7.5px;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s, color 0.16s;
}

.knowledge-toggle:hover {
  border-color: #d8c4b4;
  background: #fff;
}

.knowledge-toggle.on {
  border-color: #d7e4d9;
  background: var(--sage-soft);
  color: #4c6c56;
}

.knowledge-toggle:disabled {
  opacity: 0.5;
  cursor: wait;
}

.knowledge-toggle-track {
  position: relative;
  width: 20px;
  height: 12px;
  border-radius: 99px;
  background: #d8cdc5;
  transition: background 0.16s;
}

.knowledge-toggle-track span {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: transform 0.16s;
}

.knowledge-toggle.on .knowledge-toggle-track {
  background: var(--sage);
}

.knowledge-toggle.on .knowledge-toggle-track span {
  transform: translateX(8px);
}

.knowledge-card p {
  display: -webkit-box;
  margin: 7px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.knowledge-card-foot {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
  padding-top: 7px;
  border-top: 1px solid #f4ece5;
}

.knowledge-card-foot span {
  color: var(--muted-2);
  font-size: 7.5px;
}

.knowledge-card-foot button {
  margin-left: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 7.5px;
  cursor: pointer;
}

.knowledge-card-foot button:hover {
  color: var(--plum);
}

.knowledge-side {
  position: sticky;
  top: 0;
}

.test-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 100% 0%, rgba(201, 162, 107, 0.1), transparent 40%),
    var(--surface);
}

.test-panel h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}

.test-panel > p {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.6;
}

.test-input {
  width: 100%;
  height: 70px;
  padding: 9px 10px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  background: #fff;
  font-size: 10px;
  line-height: 1.6;
}

.test-input:focus {
  border-color: #d6beb4;
  box-shadow: 0 0 0 3px rgba(124, 74, 87, 0.05);
}

.test-result {
  margin-top: 11px;
}

.test-answer {
  padding: 10px;
  border: 1px solid #dfe9df;
  border-radius: 10px;
  background: #f4faf3;
  color: #3f5045;
  font-size: 9px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.test-matches {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
}

.test-match {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 8px;
  color: var(--muted);
}

.test-match .confidence-bar {
  width: 58px;
  flex: none;
}

.test-match strong {
  margin-left: auto;
  color: var(--ink-2);
  font-weight: 500;
}

/* quick replies */

.qr-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qr-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.qr-item-main {
  flex: 1;
  min-width: 0;
}

.qr-item-main strong {
  display: block;
  font-size: 10px;
  font-weight: 600;
}

.qr-item-main p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.qr-item-main small {
  display: block;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 7.5px;
}

/* ---------- analytics ---------- */

.analytics-top {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.funnel {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 6px;
}

.funnel-row {
  display: grid;
  grid-template-columns: 74px 1fr 38px;
  align-items: center;
  gap: 8px;
  font-size: 9px;
}

.funnel-row > span {
  color: var(--muted);
}

.funnel-bar {
  height: 20px;
  overflow: hidden;
  border-radius: 5px;
  background: #f5ede6;
}

.funnel-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--fc, var(--plum)), color-mix(in srgb, var(--fc, var(--plum)) 62%, #fff));
  opacity: 0.85;
}

.funnel-row strong {
  text-align: right;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.response-bars {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-top: 5px;
}

.response-row {
  display: grid;
  grid-template-columns: 74px 1fr 28px;
  align-items: center;
  gap: 7px;
  font-size: 8.5px;
  color: var(--muted);
}

.response-track {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: #f2eae2;
}

.response-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--rb, var(--plum));
}

.hourly {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 100px;
  padding-top: 8px;
}

.hourly-bar {
  flex: 1;
  min-height: 2px;
  border-radius: 3px 3px 1px 1px;
  background: linear-gradient(180deg, #a87480, #d8b5a8);
  opacity: 0.75;
  transition: opacity 0.16s;
}

.hourly-bar:hover {
  opacity: 1;
}

.hourly-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 7px;
}

/* ---------- settings ---------- */

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 14px;
  align-items: start;
}

.settings-stack {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.settings-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.settings-card-head {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 13px;
  padding-bottom: 11px;
  border-bottom: 1px solid #f2e9e1;
}

.settings-card-head .sc-icon {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: none;
  border-radius: 8px;
  background: var(--gold-soft);
  color: var(--gold-deep);
}

.settings-card-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
}

.settings-card-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 8.5px;
}

.setting-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 40px;
}

.setting-row + .setting-row {
  border-top: 1px solid #f7f0e9;
}

.setting-label {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.setting-label span {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.setting-label small {
  color: var(--muted-2);
  font-size: 7.5px;
}

.setting-control input[type="text"],
.setting-control input[type="number"],
.setting-control input[type="password"],
.setting-control input[type="time"],
.setting-control select {
  width: 100%;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-2);
  font-size: 9.5px;
  outline: none;
}

.setting-control input:focus,
.setting-control select:focus {
  border-color: #d6beb4;
  box-shadow: 0 0 0 3px rgba(124, 74, 87, 0.05);
}

.setting-control .inline-fields {
  display: flex;
  align-items: center;
  gap: 6px;
}

.setting-control .inline-fields span {
  color: var(--muted);
  font-size: 8px;
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  width: 35px;
  height: 20px;
  border-radius: 99px;
  background: #e5d9cf;
  transition: background 0.18s;
}

.switch-track::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: transform 0.18s;
}

.switch input:checked + .switch-track {
  background: var(--plum);
}

.switch input:checked + .switch-track::after {
  transform: translateX(15px);
}

.switch-label {
  color: var(--muted);
  font-size: 8.5px;
}

.settings-aside {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.team-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.team-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid #f4ece5;
}

.team-item:last-child {
  border-bottom: none;
}

.team-main {
  flex: 1;
  min-width: 0;
}

.team-main strong {
  display: block;
  font-size: 9.5px;
  font-weight: 600;
}

.team-main small {
  color: var(--muted);
  font-size: 7.5px;
}

.team-item .switch-track {
  width: 31px;
  height: 18px;
}

.team-item .switch-track::after {
  width: 12px;
  height: 12px;
}

.team-item .switch input:checked + .switch-track::after {
  transform: translateX(13px);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 99px;
  background: var(--sage-soft);
  color: #55715e;
  font-size: 7px;
}

.status-pill.off {
  background: #f3eeea;
  color: var(--muted);
}

.audit-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.audit-item {
  display: flex;
  gap: 7px;
  font-size: 8px;
  color: var(--muted);
}

.audit-item time {
  flex: none;
  color: var(--muted-2);
  font-size: 7.5px;
}

.audit-item strong {
  color: var(--ink-2);
  font-weight: 500;
}

/* ---------- more ---------- */

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

.more-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  transition: border-color 0.16s, transform 0.16s;
}

.more-link:hover {
  border-color: #dcc7b8;
  transform: translateY(-1px);
}

.more-link .more-icon {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 10px;
  background: var(--gold-soft);
  color: var(--gold-deep);
}

.more-link div {
  display: flex;
  flex-direction: column;
}

.more-link strong {
  font-size: 10.5px;
}

.more-link small {
  color: var(--muted);
  font-size: 8px;
}

/* ---------- modal / drawer / toast ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(43, 24, 27, 0.44);
  backdrop-filter: blur(5px);
  animation: fade-in 0.18s ease both;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  width: min(540px, 100%);
  max-height: 90dvh;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.22s cubic-bezier(0.22, 0.8, 0.36, 1) both;
}

.modal.wide {
  width: min(760px, 100%);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 19px 20px 13px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
}

.modal-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.modal-close {
  margin-left: auto;
}

.modal-body {
  padding: 17px 20px;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  padding: 12px 20px 17px;
  border-top: 1px solid var(--line);
}

.modal-foot .danger-zone {
  margin-right: auto;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-field > span {
  color: var(--ink-2);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-2);
  font-size: 10px;
  outline: none;
}

.form-field textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.6;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: #d4b9af;
  box-shadow: 0 0 0 3px rgba(124, 74, 87, 0.05);
}

.form-field small {
  color: var(--muted-2);
  font-size: 7.5px;
  line-height: 1.5;
}

.verify-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
}

.verify-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  background: #fffdfb;
}

.verify-item + .verify-item {
  border-top: 1px solid #f4ece5;
}

.verify-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
}

.verify-icon .icon {
  width: 12px;
  height: 12px;
}

.verify-icon.pass {
  background: var(--sage-soft);
  color: #4c6c56;
}

.verify-icon.warn {
  background: var(--warning-soft);
  color: var(--warning);
}

.verify-icon.fail {
  background: var(--danger-soft);
  color: var(--danger);
}

.verify-main {
  flex: 1;
  min-width: 0;
}

.verify-main strong {
  display: block;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.verify-main p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.55;
}

.webhook-box {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 9px;
  border: 1px dashed #ddcabc;
  border-radius: 8px;
  background: #fdf8f2;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 8px;
  overflow: hidden;
}

.webhook-box code {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-root {
  position: relative;
  z-index: 130;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(43, 24, 27, 0.34);
  backdrop-filter: blur(3px);
  animation: fade-in 0.18s ease both;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(500px, 94vw);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  box-shadow: -20px 0 60px rgba(43, 24, 27, 0.18);
  animation: drawer-in 0.25s cubic-bezier(0.22, 0.8, 0.36, 1) both;
}

@keyframes drawer-in {
  from { transform: translateX(24px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

.drawer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.drawer-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
}

.drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 15px 17px 26px;
}

.drawer-section {
  margin-bottom: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.drawer-section h4 {
  margin: 0 0 9px;
  color: var(--ink-2);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
}

.drawer-profile {
  display: flex;
  align-items: center;
  gap: 11px;
}

.drawer-profile h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
}

.drawer-profile p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.drawer-conv {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f4ece5;
  cursor: pointer;
}

.drawer-conv:last-child {
  border-bottom: none;
}

.drawer-conv-main {
  flex: 1;
  min-width: 0;
}

.drawer-conv-main strong {
  display: block;
  font-size: 9px;
}

.drawer-conv-main p {
  overflow: hidden;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 210px;
  max-width: 360px;
  padding: 10px 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  background: rgba(51, 29, 35, 0.95);
  color: #f7eadd;
  font-size: 10px;
  line-height: 1.5;
  box-shadow: 0 16px 38px rgba(43, 24, 27, 0.24);
  animation: toast-in 0.22s ease both;
  pointer-events: auto;
}

.toast.success {
  background: #35553f;
}

.toast.error {
  background: #733d3d;
}

.toast .icon {
  width: 14px;
  height: 14px;
  flex: none;
}

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

.toast.out {
  animation: toast-out 0.2s ease both;
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(6px); }
}

/* ---------- mobile drawer menu ---------- */

.mobile-menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px 0;
}

.mobile-menu-grid a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 10.5px;
  font-weight: 600;
}

.mobile-menu-grid .icon {
  color: var(--plum);
}

.mobile-menu-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* ---------- responsive ---------- */

@media (max-width: 1320px) {
  .inbox-shell {
    grid-template-columns: 310px minmax(340px, 1fr) 320px;
  }
  .kpi-grid {
    gap: 10px;
  }
  .kpi-value {
    font-size: 27px;
  }
}

@media (max-width: 1160px) {
  .inbox-shell {
    grid-template-columns: 306px minmax(0, 1fr);
  }
  .profile-panel {
    display: none;
  }
  .inbox-shell.show-profile .profile-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 15;
    display: flex;
    width: 340px;
    box-shadow: -16px 0 40px rgba(43, 24, 27, 0.13);
  }
  .page.inbox-page {
    position: relative;
  }
  .chat-info-btn {
    display: inline-flex !important;
  }
  .knowledge-layout,
  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .knowledge-side {
    position: static;
  }
  .span-8,
  .span-7 {
    grid-column: span 12;
  }
  .span-4,
  .span-5 {
    grid-column: span 6;
  }
  .analytics-grid .span-8,
  .analytics-grid .span-4 {
    grid-column: span 12;
  }
  .analytics-top {
    grid-template-columns: repeat(2, 1fr);
  }
  .channel-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  :root {
    --mobile-top: 54px;
    --mobile-bottom: 66px;
  }

  body {
    background: var(--bg);
  }

  .login-shell {
    display: block;
    min-height: 100dvh;
    background: var(--bg);
  }

  .login-visual {
    min-height: 0;
    padding: 25px 24px 30px;
    border-radius: 0 0 28px 28px;
  }

  .login-brand img {
    width: 36px;
    height: 36px;
  }

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

  .login-copy {
    margin-top: 28px;
  }

  .login-copy h1 {
    font-size: clamp(31px, 8vw, 42px);
    line-height: 1.3;
  }

  .login-lead {
    margin-top: 13px;
    font-size: 11.5px;
    line-height: 1.8;
  }

  .login-orbit,
  .login-foot {
    display: none;
  }

  .login-panel {
    display: block;
    padding: 25px 22px 34px;
    background: transparent;
  }

  .login-panel::before {
    display: none;
  }

  .login-panel-inner {
    max-width: 460px;
    margin: 0 auto;
  }

  .login-mobile-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    color: var(--plum);
    font-family: var(--serif);
    font-size: 15px;
  }

  .login-panel h2 {
    font-size: 29px;
  }

  .login-sub {
    margin-bottom: 20px;
    font-size: 11.5px;
  }

  .demo-grid {
    gap: 6px;
  }

  .demo-account {
    padding: 9px 8px;
  }

  .demo-account .avatar {
    width: 27px;
    height: 27px;
    font-size: 9px;
  }

  .login-legal {
    margin-top: 17px;
    font-size: 8.5px;
  }

  .app-shell {
    display: block;
    height: 100dvh;
    padding-top: var(--mobile-top);
    padding-bottom: var(--mobile-bottom);
  }

  .sidebar {
    display: none;
  }

  .mobile-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--mobile-top);
    padding: 0 12px;
    border-bottom: 1px solid rgba(234, 223, 213, 0.85);
    background: rgba(250, 246, 240, 0.9);
    backdrop-filter: blur(14px);
    padding-top: env(safe-area-inset-top);
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: var(--serif);
    font-size: 16px;
    font-weight: 600;
    color: var(--plum);
    letter-spacing: 0.08em;
  }

  .mobile-brand img {
    border-radius: 8px;
  }

  .mobile-actions {
    display: flex;
    align-items: center;
    gap: 2px;
  }

  .mobile-inbox-link {
    position: relative;
  }

  .dot-badge {
    position: absolute;
    top: 3px;
    right: 2px;
    min-width: 9px;
    height: 9px;
    padding: 0 2px;
    border-radius: 99px;
    background: var(--plum);
    color: #fff;
    font-size: 6px;
    font-style: normal;
    line-height: 9px;
    text-align: center;
  }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    align-items: stretch;
    height: var(--mobile-bottom);
    padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(234, 223, 213, 0.9);
    background: rgba(255, 252, 248, 0.94);
    backdrop-filter: blur(16px);
  }

  .mobile-nav a {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 9px;
    color: #a2928e;
    font-size: 8px;
  }

  .mobile-nav a .icon {
    width: 19px;
    height: 19px;
  }

  .mobile-nav a.active {
    color: var(--plum);
    background: #f8eee7;
  }

  .mobile-nav a.active .icon {
    stroke-width: 2;
  }

  .mobile-nav .dot-badge {
    top: 5px;
    right: calc(50% - 15px);
  }

  .page {
    height: calc(100dvh - var(--mobile-top) - var(--mobile-bottom));
    padding: 16px 14px 24px;
  }

  .page.inbox-page {
    height: calc(100dvh - var(--mobile-top) - var(--mobile-bottom));
    padding: 0;
  }

  .page-head {
    display: block;
    margin-bottom: 14px;
    padding: 0 2px;
  }

  .page-head h1 {
    font-size: 25px;
  }

  .page-head .sub {
    font-size: 10.5px;
    line-height: 1.6;
  }

  .page-head-actions {
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .inbox-shell {
    display: block;
    height: 100%;
    border: none;
    border-radius: 0;
    box-shadow: none;
    position: relative;
  }

  .conv-panel {
    height: 100%;
    border-right: none;
    background: var(--surface);
  }

  .conv-head {
    padding: 12px 14px 5px;
  }

  .conv-head h2 {
    font-size: 20px;
  }

  .conv-tabs {
    padding: 9px 10px;
  }

  .conv-list {
    padding: 0 5px 16px;
  }

  .conv-item {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    padding: 12px 9px;
  }

  .conv-preview {
    font-size: 10.5px;
  }

  .chat-panel {
    display: none;
    height: 100%;
    background: #fbf6f0;
  }

  body.chat-open .conv-panel {
    display: none;
  }

  body.chat-open .chat-panel {
    display: flex;
  }

  .chat-back {
    display: inline-grid;
  }

  .chat-header {
    min-height: 60px;
    padding: 8px 9px;
    gap: 5px;
  }

  .chat-header .avatar-lg {
    width: 42px;
    height: 42px;
    font-size: 16px;
  }

  .chat-person {
    gap: 7px;
    flex: 1;
    min-width: 0;
  }

  .chat-person-main {
    min-width: 0;
  }

  .chat-name-row h2 {
    font-size: 16px;
    max-width: 112px;
  }

  .chat-sub {
    overflow: hidden;
    white-space: nowrap;
  }

  .chat-sub .chip {
    flex: none;
  }

  .chat-stage,
  .chat-header [data-action="simulate"] {
    display: none !important;
  }

  .chat-header-actions {
    gap: 0;
    flex: none;
  }

  .chat-action span:not(.icon) {
    display: none;
  }

  .chat-action {
    width: 30px;
    padding: 0;
    justify-content: center;
  }

  .chat-messages {
    padding: 13px 13px 10px;
  }

  .chat-notice {
    margin: 0 13px;
    font-size: 8px;
  }

  .message {
    margin-bottom: 10px;
  }

  .msg-body {
    max-width: 82%;
  }

  .msg-bubble {
    padding: 9px 11px;
    font-size: 12.5px;
    line-height: 1.7;
  }

  .message-avatar {
    display: none;
  }

  .chat-composer {
    padding: 7px 10px calc(8px + env(safe-area-inset-bottom));
  }

  .composer-box textarea {
    height: 46px;
    font-size: 13px;
  }

  .composer-hint {
    display: none;
  }

  .quick-pop,
  .ai-pop {
    left: 10px;
    right: 10px;
    bottom: calc(100% - 2px);
  }

  .profile-panel {
    display: none !important;
  }

  .mobile-chat-profile {
    position: fixed;
    top: var(--mobile-top);
    left: 0;
    right: 0;
    bottom: var(--mobile-bottom);
    z-index: 55;
    display: flex;
    flex-direction: column;
    background: #fffdfb;
  }

  .mobile-chat-profile .profile-scroll {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 30px;
  }

  .mobile-chat-profile-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
  }

  .mobile-chat-profile-head strong {
    font-family: var(--serif);
    font-size: 17px;
  }

  .mobile-chat-profile-head .profile-tabs {
    flex: 1;
    border-bottom: none;
    margin-left: 8px;
  }

  .mobile-chat-profile-head .profile-tab {
    height: 34px;
    font-size: 9px;
  }

  .hero {
    display: block;
    padding: 18px;
  }

  .hero-copy h2 {
    font-size: 19px;
  }

  .hero-copy p {
    font-size: 10px;
    line-height: 1.65;
  }

  .hero-actions {
    margin-top: 12px;
  }

  .hero-orb {
    display: none;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .kpi {
    padding: 13px;
  }

  .kpi-value {
    font-size: 25px;
  }

  .kpi-foot {
    font-size: 8px;
  }

  .dash-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8,
  .span-9,
  .span-12 {
    grid-column: span 1;
  }

  .chart-card {
    padding: 15px;
  }

  .donut-wrap {
    gap: 14px;
  }

  .donut {
    width: 108px;
    height: 108px;
  }

  .donut::after {
    inset: 20px;
  }

  .toolbar {
    gap: 5px;
  }

  .search-box {
    flex: 1;
    min-width: 150px;
  }

  .filter-chip {
    height: 29px;
    padding: 0 9px;
    font-size: 9px;
  }

  .customer-grid {
    grid-template-columns: 1fr;
  }

  .table-card {
    overflow-x: auto;
    border-radius: 16px;
  }

  .data-table {
    min-width: 660px;
  }

  .kanban {
    height: calc(100dvh - var(--mobile-top) - var(--mobile-bottom) - 132px);
    grid-auto-columns: 250px;
  }

  .channel-grid {
    gap: 10px;
  }

  .integration-guide {
    grid-template-columns: 1fr;
  }

  .knowledge-layout {
    gap: 12px;
  }

  .knowledge-list {
    grid-template-columns: 1fr;
  }

  .analytics-top {
    gap: 8px;
  }

  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .modal {
    width: 100%;
    max-height: 92dvh;
    border-radius: 22px 22px 0 0;
    animation: sheet-in 0.24s cubic-bezier(0.22, 0.8, 0.36, 1) both;
  }

  @keyframes sheet-in {
    from { transform: translateY(30px); opacity: 0.7; }
    to { transform: translateY(0); opacity: 1; }
  }

  .modal-head {
    padding: 16px 17px 11px;
  }

  .modal-body {
    padding: 14px 17px;
  }

  .modal-foot {
    padding: 10px 17px calc(14px + env(safe-area-inset-bottom));
  }

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

  .drawer {
    top: var(--mobile-top);
    width: 100%;
    border-radius: 20px 0 0 0;
  }

  .toast-root {
    left: 14px;
    right: 14px;
    bottom: calc(var(--mobile-bottom) + 12px);
  }

  .toast {
    max-width: none;
    width: 100%;
  }

  .settings-layout {
    gap: 10px;
  }

  .setting-row {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 8px 0;
  }

  .setting-row + .setting-row {
    margin-top: 2px;
  }

  .settings-card {
    padding: 15px;
  }

  .more-grid {
    grid-template-columns: 1fr 1fr;
  }

  .mobile-menu-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 420px) {
  .login-copy h1 {
    font-size: 29px;
  }

  .login-lead {
    font-size: 10.5px;
  }

  .demo-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .demo-account small {
    font-size: 7.5px;
  }

  .kpi-grid {
    gap: 7px;
  }

  .kpi-label {
    font-size: 9.5px;
  }

  .kpi-value {
    font-size: 23px;
  }

  .hero-copy h2 {
    font-size: 17px;
    line-height: 1.5;
  }

  .msg-body {
    max-width: 86%;
  }

  .more-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
