/*
 * PNQ Leads UI v2
 * Visual-only design layer. Business behavior remains in app.js.
 */

:root {
  --ink: #18231f;
  --muted: #718079;
  --line: #e5ebe7;
  --paper: #ffffff;
  --bg: #f3f6f4;
  --green: #164e3b;
  --green-strong: #0d3b2c;
  --green-soft: #e9f2ed;
  --lime: #d8ee6c;
  --lime-soft: #f2f7d8;
  --danger: #b74141;
  --warning: #b4771f;
  --blue: #356ea9;
  --purple: #7254a8;
  --shadow-sm: 0 1px 2px rgba(20, 49, 38, 0.04);
  --shadow-md: 0 14px 38px rgba(20, 49, 38, 0.08);
  --shadow-lg: 0 28px 80px rgba(16, 45, 36, 0.16);
  --radius-sm: 9px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

/* Role, account and organization access control */
.permission-hidden{display:none!important}
.stat-filter-card{position:relative;cursor:pointer;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;outline:none}
.stat-filter-card:hover{transform:translateY(-2px);box-shadow:0 12px 28px rgba(18,64,49,.12)}
.stat-filter-card:focus-visible{box-shadow:0 0 0 3px rgba(36,112,83,.18),0 12px 28px rgba(18,64,49,.1)}
.stat-filter-card.active{border-color:#2d7b5d;box-shadow:inset 0 0 0 1px #2d7b5d,0 10px 24px rgba(18,64,49,.1)}
.stat-filter-card.active::after{content:"已筛选";position:absolute;right:14px;bottom:12px;padding:3px 8px;border-radius:999px;background:#e7f4ee;color:#176246;font-size:10px;font-weight:700}
.stat-filter-card.accent.active::after{background:rgba(23,98,70,.12)}
.access-panel{overflow:visible}
.access-head{align-items:flex-start}
.access-head>div:last-child{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.access-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:8px 0 22px}
.access-summary article{padding:18px;border:1px solid #dce8e2;border-radius:16px;background:linear-gradient(145deg,#fff,#f4f9f6)}
.access-summary span,.access-summary small{display:block;color:#71847b;font-size:12px}
.access-summary strong{display:block;margin:6px 0;font-size:28px;color:#173b30}
.access-columns{display:grid;gap:28px}
.access-section-title{display:flex;justify-content:space-between;align-items:end;margin-bottom:12px}
.access-section-title h3{margin:0;color:#173b30}
.access-section-title small{color:#809087}
.role-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px}
.role-card{display:grid;grid-template-columns:42px 1fr auto;gap:12px;align-items:center;width:100%;padding:16px;border:1px solid #dce8e2;border-radius:15px;background:#fff;text-align:left;color:#173b30;cursor:pointer;transition:.18s ease}
.role-card:hover{border-color:#82b49f;transform:translateY(-1px);box-shadow:0 10px 24px rgba(20,69,52,.08)}
.role-card-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:13px;background:#e6f4ed;color:#146044;font-size:18px;font-weight:800}
.role-card span:nth-child(2)>b,.role-card span:nth-child(2)>small,.role-card span:nth-child(2)>em{display:block}
.role-card span:nth-child(2)>small{margin:4px 0;color:#72857c;font-size:11px}
.role-card span:nth-child(2)>em{color:#4e7062;font-size:11px;font-style:normal}
.role-card>i{color:#2f7a5e;font-size:12px;font-style:normal}
.account-name{font-weight:700;color:#245c48}
.super-account-row{background:#f7fbf8}
.wide-dialog{width:min(940px,calc(100vw - 34px));max-width:none}
.access-dialog{width:min(560px,calc(100vw - 34px));max-width:none}
.access-dialog.wide-dialog{width:min(940px,calc(100vw - 34px))}
.access-dialog .dialog-head,.transfer-dialog .dialog-head{align-items:flex-start}
.access-dialog .dialog-head small,.transfer-dialog .dialog-head small{display:block;margin-top:4px;color:#72857c}
.access-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.field-wide{grid-column:1/-1}
.switch-field{display:flex!important;flex-direction:row!important;align-items:center;gap:10px;padding:11px 12px;border:1px solid #dbe7e1;border-radius:10px;background:#f7faf8}
.switch-field input{width:18px;height:18px;flex:none}
.dialog-action-row{display:flex;justify-content:flex-end;gap:10px;align-items:center}
.permission-toolbar{display:flex;justify-content:space-between;align-items:end;margin-top:10px;padding-top:16px;border-top:1px solid #e2ebe6}
.permission-toolbar h3{margin:0 0 3px;color:#173b30}.permission-toolbar small{color:#778980}.permission-toolbar>span{color:#316c57;font-size:12px;font-weight:700}
.permission-matrix{display:grid;grid-auto-rows:max-content;align-content:start;gap:13px;min-height:0;max-height:46vh;overflow:auto;padding-right:4px}
.permission-group{display:grid;grid-template-columns:130px 1fr;border:1px solid #dee9e3;border-radius:14px;overflow:hidden}
.permission-group>div:first-child{padding:15px;background:#f3f8f5}.permission-group h4{margin:0 0 4px;color:#234d3d}.permission-group>div:first-child small{color:#83928b}
.permission-item{display:grid!important;grid-template-columns:minmax(180px,1fr) 56px 95px;gap:10px;align-items:center;padding:10px 12px;border-bottom:1px solid #edf2ef}
.permission-item:last-child{border-bottom:0}.permission-item span b,.permission-item span small{display:block}.permission-item span small{margin-top:2px;color:#7b8d84;font-size:10px}.permission-item>em{padding:3px 6px;border-radius:999px;background:#edf4f0;color:#577064;font-size:10px;text-align:center;font-style:normal}.permission-item.risk-high>em{background:#fff0ed;color:#b64a36}.permission-item.risk-manage>em{background:#fff7dc;color:#8e6810}.permission-item select{height:34px}
#roleEditDialog[open]{display:flex;flex-direction:column;width:min(940px,calc(100vw - 34px));height:min(900px,calc(100dvh - 32px));max-height:calc(100dvh - 32px);padding:0;overflow:hidden}
#roleEditDialog .dialog-head{flex:0 0 auto;padding:22px 24px 18px}
#roleEditDialog .dialog-form{flex:1;min-height:0;display:grid;grid-template-rows:auto auto minmax(0,1fr) auto auto;gap:12px;padding:18px 24px 20px;overflow:hidden}
#roleEditDialog .permission-toolbar{margin-top:0;padding-top:12px}
#roleEditDialog .permission-matrix{max-height:none;overscroll-behavior:contain;scrollbar-gutter:stable}
#roleEditDialog .dialog-action-row{padding-top:12px;border-top:1px solid #e5ece8}
.department-checks{display:flex;flex-wrap:wrap;gap:8px}.department-checks label{display:flex!important;flex-direction:row!important;align-items:center;gap:6px;padding:7px 10px;border:1px solid #dbe7e1;border-radius:999px;background:#f7faf8}.department-checks input{width:15px;height:15px}
.password-result-dialog .temporary-password-body{display:grid;gap:12px;padding:8px 0}.temporary-password-body>p{margin:0;color:#6f8178}.temporary-password-body>div{padding:12px 14px;border:1px solid #d9e7e0;border-radius:12px;background:#f5faf7}.temporary-password-body span,.temporary-password-body strong{display:block}.temporary-password-body span{color:#778a81;font-size:11px}.temporary-password-body strong{margin-top:5px;color:#163f30;font-size:16px;word-break:break-all}
.transfer-dialog{width:min(940px,calc(100vw - 34px));max-width:none}
.transfer-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.transfer-summary article{padding:14px;border:1px solid #dce8e2;border-radius:13px;background:#f7faf8}.transfer-summary span,.transfer-summary b,.transfer-summary small{display:block}.transfer-summary span{font-size:11px;color:#7d8e86}.transfer-summary b{margin:4px 0;color:#173d2f;font-size:18px}.transfer-summary small{color:#677c72}
.transfer-strategies{display:grid;grid-template-columns:1fr 1fr;gap:9px}.transfer-strategies>label{display:flex!important;flex-direction:row!important;gap:10px;padding:12px;border:1px solid #dbe7e1;border-radius:12px;background:#fff;cursor:pointer}.transfer-strategies input{width:17px;height:17px;margin-top:2px;flex:none}.transfer-strategies span b,.transfer-strategies span small{display:block}.transfer-strategies span small{margin-top:3px;color:#788a82;font-size:10px}
.transfer-split-area{border:1px solid #dbe7e1;border-radius:14px;overflow:hidden}.transfer-split-head{display:flex;justify-content:space-between;padding:12px 14px;background:#f1f7f4}.transfer-split-head small{color:#71837a}.transfer-split-list{max-height:290px;overflow:auto}.transfer-split-row{display:grid;grid-template-columns:1fr 125px 150px;gap:8px;align-items:center;padding:9px 12px;border-top:1px solid #edf2ef}.transfer-split-row span b,.transfer-split-row span small{display:block}.transfer-split-row span small{color:#7b8b84;font-size:10px}.transfer-split-row select{height:34px}
.transfer-confirm-note{display:flex;gap:10px;padding:11px 13px;border-radius:11px;background:#fff8dc;color:#765b14;font-size:12px}.table-actions{display:flex;flex-wrap:wrap;gap:6px}
@media (max-width:760px){
  .access-summary,.transfer-summary{grid-template-columns:1fr}
  .access-form-grid,.transfer-strategies{grid-template-columns:1fr}
  .permission-group{grid-template-columns:1fr}.permission-group>div:first-child{padding:10px 12px}
  .permission-item{grid-template-columns:1fr 56px 90px}
  .transfer-split-row{grid-template-columns:1fr}.transfer-split-row select{width:100%}
}
@media (max-width:520px){
  #roleEditDialog[open]{width:calc(100vw - 20px)!important;height:calc(100dvh - 20px);max-height:calc(100dvh - 20px)}
  #roleEditDialog .dialog-head{padding:17px 16px 14px}
  #roleEditDialog .dialog-form{padding:14px 16px 16px}
  #roleEditDialog .permission-toolbar{align-items:flex-start;gap:8px}
  .permission-item{grid-template-columns:minmax(0,1fr) 90px}
  .permission-item>em{grid-column:1;justify-self:start}
  .permission-item>select{grid-column:2;grid-row:1/3;width:100%}
}
@media (max-height:680px){
  #roleEditDialog .dialog-form{display:block;overflow:auto}
  #roleEditDialog .permission-toolbar{margin-top:16px}
  #roleEditDialog .permission-matrix{min-height:230px;max-height:52vh;margin-top:12px}
  #roleEditDialog .dialog-action-row{margin-top:12px}
}

html {
  color-scheme: light;
  background: var(--bg);
}

body {
  min-width: 320px;
  background:
    radial-gradient(circle at 84% -10%, rgba(216, 238, 108, 0.12), transparent 31rem),
    var(--bg);
  color: var(--ink);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(216, 238, 108, 0.48);
  color: var(--green-strong);
}

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

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

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

button,
input,
select,
textarea {
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(79, 139, 111, 0.2);
  outline-offset: 2px;
}

input,
select,
textarea {
  border-color: #dce5e0;
  border-radius: var(--radius-sm);
  background: #fff;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #bdccc4;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #4f8b6f;
  box-shadow: 0 0 0 4px rgba(79, 139, 111, 0.11);
}

/* Login */

.auth-shell {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(14, 56, 42, 0.97), rgba(23, 78, 59, 0.92)),
    #123d2e;
}

.auth-shell::before,
.auth-shell::after {
  position: absolute;
  z-index: -1;
  content: "";
  border-radius: 50%;
  filter: blur(1px);
}

.auth-shell::before {
  top: -16vw;
  right: -8vw;
  width: 46vw;
  height: 46vw;
  background: rgba(216, 238, 108, 0.18);
}

.auth-shell::after {
  bottom: -22vw;
  left: -13vw;
  width: 48vw;
  height: 48vw;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.035);
}

.auth-card {
  position: relative;
  width: min(448px, calc(100vw - 32px));
  padding: 48px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 36px 100px rgba(3, 30, 21, 0.34);
  backdrop-filter: blur(20px);
}

.auth-card::after {
  position: absolute;
  top: 0;
  right: 32px;
  left: 32px;
  height: 3px;
  content: "";
  border-radius: 0 0 99px 99px;
  background: linear-gradient(90deg, transparent, var(--lime), transparent);
}

.brand-mark {
  width: 56px;
  height: 56px;
  margin-bottom: 26px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 17px;
  background: linear-gradient(145deg, #1b654c, #0e3e2e);
  box-shadow: 0 12px 26px rgba(22, 78, 59, 0.23);
}

.auth-card .eyebrow {
  color: #708179;
}

.auth-card h1 {
  font-size: 31px;
  letter-spacing: -0.045em;
}

.auth-card .muted {
  margin: 10px 0 0;
  line-height: 1.6;
}

.auth-card form {
  gap: 17px;
  margin-top: 28px;
}

.auth-card label {
  color: #3c4a44;
  font-weight: 700;
}

.auth-card input {
  height: 48px;
  border-color: #dce4df;
  background: #fbfcfb;
}

.auth-card .primary {
  height: 49px;
  margin-top: 2px;
}

/* Application frame */

.app {
  grid-template-columns: 248px minmax(0, 1fr);
  background: transparent;
}

.app > aside {
  display: flex !important;
  flex-direction: column;
  width: 248px;
  padding: 24px 16px;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  background:
    radial-gradient(circle at 18% 0, rgba(216, 238, 108, 0.12), transparent 17rem),
    linear-gradient(180deg, #123b2e 0%, #0d2f24 100%);
  box-shadow: 10px 0 35px rgba(22, 55, 43, 0.04);
}

.logo {
  flex: 0 0 auto;
  gap: 13px;
  padding: 3px 10px 25px;
}

.logo > span {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(145deg, #e3f37f, #c8e158);
  box-shadow: 0 10px 22px rgba(5, 29, 20, 0.23);
}

.logo b {
  font-size: 15px;
  letter-spacing: 0.08em;
}

.logo small {
  color: rgba(219, 234, 227, 0.56);
}

.app > aside nav {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 3px 10px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(216, 238, 108, 0.32) transparent;
}

.app > aside nav::-webkit-scrollbar { width: 5px; }
.app > aside nav::-webkit-scrollbar-track { background: transparent; }
.app > aside nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(216, 238, 108, 0.28);
}

.nav {
  position: relative;
  min-height: 43px;
  gap: 13px;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: rgba(229, 240, 234, 0.68);
  font-size: 13px;
}

.nav:hover {
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.075);
  color: #fff;
  transform: translateX(2px);
}

.nav.active {
  border-color: rgba(216, 238, 108, 0.16);
  background: linear-gradient(90deg, rgba(216, 238, 108, 0.17), rgba(216, 238, 108, 0.07));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--lime);
}

.nav.sub {
  min-height: 38px;
  padding-left: 37px;
  font-size: 12px;
}

.nav-sub {
  display: grid;
  gap: 3px;
  padding: 3px 0 5px;
}

.aside-foot {
  position: static;
  flex: 0 0 auto;
  width: 100%;
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(218, 234, 226, 0.65);
}

.pulse {
  background: var(--lime);
  box-shadow: 0 0 0 5px rgba(216, 238, 108, 0.12);
}

main {
  grid-column: 2;
  padding: 28px 34px 48px;
}

/* Website filing and ownership information */
.site-compliance-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  color: #819087;
  font-size: 11px;
  line-height: 1.7;
  text-align: center;
}

.site-compliance-footer a {
  color: inherit;
  text-decoration: none;
  transition: color 0.18s ease;
}

.site-compliance-footer a:hover,
.site-compliance-footer a:focus-visible {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-compliance-footer {
  position: absolute;
  z-index: 1;
  right: 24px;
  bottom: 20px;
  left: 24px;
  color: rgba(231, 241, 235, 0.65);
}

.auth-shell {
  padding-bottom: 82px;
}

.auth-compliance-footer a:hover,
.auth-compliance-footer a:focus-visible {
  color: #fff;
}

.app-compliance-footer {
  margin: 30px 0 -22px;
  padding: 18px 12px 0;
  border-top: 1px solid rgba(210, 221, 215, 0.78);
}

.app > main > header {
  position: sticky;
  z-index: 8;
  top: 0;
  gap: 24px;
  margin: -28px -34px 24px;
  padding: 24px 34px 20px;
  border-bottom: 1px solid rgba(218, 227, 222, 0.76);
  background: rgba(243, 246, 244, 0.9);
  backdrop-filter: blur(16px);
}

.app > main > header h1 {
  font-size: 28px;
  letter-spacing: -0.04em;
}

.app > main > header .muted {
  max-width: 620px;
  color: #74817b;
}

.head-actions {
  justify-content: flex-end;
  gap: 9px;
}

.user {
  gap: 9px;
  margin-left: 4px;
  padding: 4px 4px 4px 11px;
  border: 1px solid #e0e7e3;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.74);
}

.user > span {
  width: 36px;
  height: 36px;
  background: linear-gradient(145deg, #e5efe9, #d4e3da);
  box-shadow: inset 0 0 0 1px rgba(22, 78, 59, 0.06);
}

.user div {
  min-width: 44px;
}

.user b {
  overflow: hidden;
  max-width: 88px;
  text-overflow: ellipsis;
}

.notify-bell {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 9px;
  filter: saturate(0.35);
}

.notify-bell:hover {
  background: var(--green-soft);
  filter: none;
}

/* Buttons and controls */

.primary {
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #1b634b, #124734);
  box-shadow: 0 7px 17px rgba(18, 71, 52, 0.16);
}

.primary:hover {
  background: linear-gradient(135deg, #1c6b50, #10422f);
  box-shadow: 0 10px 22px rgba(18, 71, 52, 0.22);
  transform: translateY(-1px);
}

.primary:active {
  box-shadow: 0 3px 9px rgba(18, 71, 52, 0.16);
  transform: translateY(0);
}

.ghost,
.text-btn {
  border-color: #dce5e0;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.88);
  color: #405049;
  box-shadow: var(--shadow-sm);
}

.ghost:hover {
  border-color: #9eb7aa;
  background: #fff;
  color: var(--green);
  box-shadow: 0 6px 16px rgba(22, 78, 59, 0.08);
  transform: translateY(-1px);
}

.text-btn {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none !important;
}

/* Dashboard */

.data-range-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  width: fit-content;
  max-width: 100%;
  margin: -4px 0 14px auto;
  padding: 8px 9px 8px 13px;
  border: 1px solid rgba(218, 227, 222, 0.94);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.data-range-caption {
  display: flex;
  align-items: center;
  gap: 9px;
}

.data-range-caption > div {
  display: grid;
  gap: 2px;
}

.data-range-caption b {
  color: #34463e;
  font-size: 12px;
}

.data-range-caption small {
  max-width: 260px;
  overflow: hidden;
  color: #829088;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-range-dot {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--lime-soft);
  color: var(--green);
  font-size: 16px;
  font-weight: 800;
}

.data-range-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.data-range-control > span {
  color: #77857e;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

#dataRange {
  width: 132px;
  height: 36px;
  padding: 0 32px 0 11px;
  border-color: #d8e3dd;
  border-radius: 9px;
  background-color: #f8faf9;
  color: #263a31;
  font-size: 12px;
  font-weight: 700;
}

.custom-range-fields {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding-left: 12px;
  border-left: 1px solid #e1e8e4;
}

.custom-range-fields label {
  display: grid;
  gap: 3px;
}

.custom-range-fields label > span {
  color: #829088;
  font-size: 9px;
  font-weight: 700;
}

.custom-range-fields input {
  width: 132px;
  height: 36px;
  padding: 0 9px;
  border-color: #d8e3dd;
  border-radius: 9px;
  background: #fff;
  color: #263a31;
  font-size: 11px;
}

.custom-range-separator {
  align-self: center;
  margin-top: 12px;
  color: #829088;
  font-size: 11px;
}

.custom-range-apply {
  height: 36px;
  padding: 0 15px;
  border: 0;
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 750;
}

.leads-table-wrap td small.channel-smartphone-hint {
  color: #c2410c;
  font-weight: 750;
}

.stats {
  gap: 14px;
  margin-bottom: 18px;
}

.stats article {
  min-height: 132px;
  padding: 19px 20px;
  border-color: rgba(219, 227, 222, 0.92);
  border-radius: var(--radius-md);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(251, 252, 251, 0.94));
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.stats article::after {
  position: absolute;
  top: -34px;
  right: -30px;
  width: 95px;
  height: 95px;
  content: "";
  border-radius: 50%;
  background: rgba(22, 78, 59, 0.035);
}

.stats article:hover {
  border-color: #cad9d1;
  box-shadow: 0 12px 28px rgba(22, 55, 43, 0.075);
  transform: translateY(-2px);
}

.stats article span {
  color: #607069;
  font-weight: 700;
}

.stats article strong {
  margin: 10px 0 5px;
  color: #17251f;
  font-size: clamp(27px, 2vw, 34px);
  font-variant-numeric: tabular-nums;
}

.stats article small {
  color: #8a9791;
}

.stats .accent {
  border-color: #dbe8a4;
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.56), transparent 48%),
    linear-gradient(145deg, #e8f3b9, #dceaa0);
}

.stats .accent::after {
  background: rgba(22, 78, 59, 0.08);
}

.panel {
  overflow: visible;
  border-color: rgba(218, 227, 222, 0.92);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.panel-top {
  padding: 22px 24px 14px;
}

.panel h2 {
  color: #1b2a24;
  font-size: 18px;
  letter-spacing: -0.015em;
}

.sync-state {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: #4d6e5e;
}

.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 24px 19px;
  border: 0;
  background: transparent;
}

.filters .search-box {
  flex: 1 1 250px;
  min-width: 210px;
}

.filters #q {
  width: 100%;
}

.filters input,
.filters select {
  width: auto;
  min-width: 108px;
  height: 38px;
  padding: 0 10px;
  border-color: #dce5e0;
  border-radius: 9px;
  background-color: #fafcfb;
  color: #46554e;
  font-size: 12px;
}

.filters input[type="date"] {
  width: 132px;
}

.filters button {
  min-width: 62px;
  height: 38px;
  padding: 0 13px;
  white-space: nowrap;
}

.filters .search-prefix {
  left: 11px;
  color: #8b9992;
}

.filters .search-box input {
  padding-left: 31px !important;
}

.leads-export {
  height: 38px !important;
  margin-left: 0 !important;
  padding: 0 13px !important;
  border: 1px solid #dce5e0 !important;
  border-radius: 9px !important;
  color: #5e6e66 !important;
}

.leads-export:hover {
  border-color: #9eb7aa !important;
  color: var(--green) !important;
}

.batch-bar {
  display: none;
  gap: 8px;
  margin: 0 24px 12px;
  padding: 10px 12px;
  border: 1px solid #cfe1d7;
  border-radius: 11px;
  background: #edf5f0;
  color: var(--green);
}

.batch-bar.show {
  display: flex;
}

.batch-bar button,
.batch-bar select,
.batch-bar input {
  height: 33px;
  border-radius: 8px;
  font-size: 12px;
}

/* Data tables */

.table-wrap,
.leads-table-wrap {
  border-top: 1px solid var(--line);
  background: #fff;
}

.leads-table-wrap {
  margin: 0 18px;
  border: 1px solid #e4eae7;
  border-radius: 13px;
  max-height: calc(100vh - 382px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

table {
  font-variant-numeric: tabular-nums;
}

th {
  padding: 12px 14px;
  border-bottom: 1px solid #dfe7e2;
  background: #f7faf8;
  color: #68766f;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.035em;
}

td {
  padding: 13px 14px;
  border-bottom-color: #edf1ef;
  color: #35443d;
}

tbody tr {
  transition:
    background-color 0.15s ease,
    box-shadow 0.15s ease;
}

tbody tr:hover td,
.leads-table-wrap tbody tr:hover td {
  background: #f7faf8;
}

.leads-table-wrap tbody tr.selected td {
  background: #eef6f1;
}

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

.external-owner-bound,
.external-owner-unmatched {
  display: block;
  margin-top: 4px;
  line-height: 1.35;
}

.external-owner-bound {
  color: #4d7463;
}

.external-owner-unmatched {
  color: #b56a18;
  font-weight: 700;
}

.external-staff-dialog {
  width: min(1180px, calc(100vw - 48px));
}

.external-staff-body {
  display: grid;
  gap: 14px;
  padding: 18px 22px 22px;
}

.external-staff-body .access-summary {
  margin: 0;
}

.external-staff-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
}

.external-staff-toolbar label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #53665d;
  font-size: 12px;
  font-weight: 700;
}

.external-staff-toolbar input {
  width: 15px;
  height: 15px;
}

.external-staff-body .table-wrap {
  max-height: min(58vh, 560px);
  overflow: auto;
  border: 1px solid #e1e9e4;
  border-radius: 12px;
}

.external-staff-body table {
  min-width: 980px;
}

.external-staff-body th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.external-staff-body td small,
.external-staff-body td code {
  display: block;
  margin-top: 4px;
}

.external-staff-body td code {
  max-width: 180px;
  overflow: hidden;
  color: #66766e;
  font-size: 11px;
  text-overflow: ellipsis;
}

.external-staff-user {
  width: 220px;
  min-height: 36px;
  border-color: #d8e3dd;
  border-radius: 8px;
  background: #fbfdfc;
  font-size: 12px;
}

.external-staff-footnote {
  margin: 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: #f4f8f6;
  color: #718078;
  font-size: 11px;
  line-height: 1.65;
}

@media (max-width: 760px) {
  .team-head-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .external-staff-dialog {
    width: calc(100vw - 18px);
  }
}

/* Employee management */

.team-management-panel {
  overflow: hidden;
  background:
    radial-gradient(circle at 94% 0, rgba(216, 236, 225, 0.42), transparent 300px),
    #fff;
}

.team-management-head {
  align-items: center;
  padding: 25px 26px 18px;
}

.team-management-head h2 {
  margin-top: 3px;
  font-size: 21px;
}

.team-management-head .muted {
  margin-top: 5px;
}

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

.team-overview article {
  display: flex;
  min-width: 0;
  gap: 12px;
  align-items: center;
  padding: 15px;
  border: 1px solid #e1eae5;
  border-radius: 14px;
  background: rgba(250, 252, 251, 0.92);
}

.team-overview-icon {
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #e8f2ed;
  color: #28614a;
  font-size: 14px;
  font-weight: 800;
}

.team-overview article div {
  display: grid;
  min-width: 0;
  grid-template-columns: 1fr auto;
  column-gap: 8px;
  align-items: baseline;
}

.team-overview small {
  overflow: hidden;
  color: #687970;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-overview b {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: #173d2f;
  font-size: 25px;
}

.team-overview em {
  overflow: hidden;
  color: #96a29c;
  font-size: 10px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 19px 24px 4px;
  border-top: 1px solid #e7ede9;
}

.team-section-head h3 {
  margin: 0 0 4px;
  color: #243a31;
  font-size: 15px;
}

.team-section-head small,
.team-section-head > span {
  color: #89968f;
  font-size: 11px;
}

.team-section-head > span {
  padding: 6px 9px;
  border-radius: 999px;
  background: #f0f5f2;
}

.department-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 14px;
  padding: 14px 24px 26px;
}

.team-dept-card.dept-card {
  display: grid;
  gap: 14px;
  padding: 17px;
  border: 1px solid #e1e9e5;
  border-top: 3px solid var(--dept-accent);
  border-radius: 15px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--dept-accent) 6%, white), #fff 58%);
  box-shadow: 0 6px 18px rgba(28, 60, 47, 0.045);
  cursor: pointer;
}

.team-dept-card.dept-card:hover {
  border-color: color-mix(in srgb, var(--dept-accent) 34%, #dfe7e3);
  border-top-color: var(--dept-accent);
  box-shadow: 0 14px 30px rgba(24, 58, 44, 0.09);
  transform: translateY(-2px);
}

.dept-card-top,
.dept-card-metrics,
.team-dept-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.team-dept-card .dept-card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--dept-accent) 15%, white);
  color: var(--dept-accent);
  font-size: 18px;
}

.team-dept-card .dept-card-actions {
  opacity: 0.35;
  transition: opacity 0.15s;
}

.team-dept-card:hover .dept-card-actions {
  opacity: 1;
}

.team-dept-card .dept-card-body {
  gap: 4px;
}

.team-dept-card .dept-card-body b {
  color: #20362d;
  font-size: 16px;
}

.team-dept-card .dept-card-body small {
  color: #94a099;
  font-size: 10px;
}

.dept-card-metrics {
  justify-content: flex-start;
  gap: 0;
  padding: 11px 0;
  border-top: 1px solid #e8eeeb;
  border-bottom: 1px solid #e8eeeb;
}

.dept-card-metrics span {
  display: grid;
  flex: 1;
  gap: 2px;
  text-align: center;
}

.dept-card-metrics span + span {
  border-left: 1px solid #e7ece9;
}

.dept-card-metrics b {
  color: #2f4f41;
  font-size: 16px;
}

.dept-card-metrics small {
  color: #98a39d;
  font-size: 10px;
}

.team-dept-card footer {
  color: #507262;
  font-size: 11px;
  font-weight: 700;
}

.team-dept-card footer i {
  font-size: 17px;
  font-style: normal;
}

.department-empty {
  display: grid;
  grid-column: 1 / -1;
  justify-items: center;
  gap: 7px;
  padding: 48px;
  border: 1px dashed #d5e0da;
  border-radius: 15px;
  color: #75847d;
}

.department-empty span {
  font-size: 26px;
}

.department-empty small {
  color: #99a49e;
}

.department-employee-head {
  border-top: 1px solid #e7ede9;
}

.department-employee-head > div {
  display: flex;
  gap: 13px;
  align-items: center;
}

.department-employee-head span {
  display: grid;
  gap: 3px;
}

.department-employee-head h2 {
  margin: 0;
}

.department-employee-head small {
  color: #8a9891;
  font-size: 11px;
}

.team-employee-table {
  margin: 0 22px 24px;
  overflow: auto;
  border: 1px solid #e3eae6;
  border-radius: 12px;
}

.employee-name-cell {
  display: flex;
  gap: 9px;
  align-items: center;
}

.employee-name-cell > span {
  display: grid;
  flex: 0 0 30px;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: #e9f2ed;
  color: #2d674f;
  font-size: 12px;
  font-weight: 800;
}

.employee-number {
  display: inline-flex;
  padding: 5px 8px;
  border: 1px solid #cfe0d7;
  border-radius: 7px;
  background: #f1f7f4;
  color: #245c45;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.employee-number.empty {
  border-color: #e3e7e5;
  background: #f7f8f7;
  color: #9aa39f;
  letter-spacing: 0;
}

/* New employee dialog */

.employee-create-dialog {
  width: min(780px, calc(100vw - 32px));
  max-height: min(850px, calc(100vh - 32px));
}

.employee-create-head {
  padding: 22px 25px;
  background:
    radial-gradient(circle at 88% 0, rgba(222, 241, 185, 0.55), transparent 210px),
    linear-gradient(135deg, #fff, #f5faf7);
}

.employee-create-head h2 {
  margin: 3px 0;
  color: #123d2e;
  font-size: 23px;
}

.employee-create-head small {
  color: #7d8e85;
}

.employee-create-form {
  display: grid;
  gap: 14px;
  padding: 18px 22px 20px;
  background: #f4f7f5;
}

.employee-form-section {
  display: grid;
  gap: 15px;
  padding: 18px;
  border: 1px solid #dfe8e3;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(23, 61, 46, 0.035);
}

.employee-form-section-title {
  display: flex;
  gap: 11px;
  align-items: center;
}

.employee-form-section-title > span {
  display: grid;
  flex: 0 0 34px;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: #e9f3ee;
  color: #266149;
  font-size: 11px;
  font-weight: 800;
}

.employee-form-section-title h3 {
  margin: 0 0 2px;
  color: #294138;
  font-size: 14px;
}

.employee-form-section-title small {
  color: #929e98;
  font-size: 10px;
}

.employee-number-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 0.75fr);
  gap: 13px;
  align-items: end;
  padding: 14px;
  border: 1px solid #dce8e1;
  border-radius: 12px;
  background: linear-gradient(135deg, #f5faf7, #fbfdfc);
}

.employee-number-input {
  display: flex;
  height: 44px;
  margin-top: 6px;
  overflow: hidden;
  border: 1px solid #cddbd3;
  border-radius: 10px;
  background: #fff;
}

.employee-number-input > span {
  display: grid;
  flex: 0 0 40px;
  place-items: center;
  border-right: 1px solid #e0e7e3;
  background: #edf5f1;
  color: #527364;
  font-weight: 800;
}

.employee-number-input input {
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #174c37;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 0.16em;
}

.employee-number-input input[readonly] {
  color: #315c49;
  cursor: default;
}

.employee-number-input input.invalid {
  color: #b43737;
  box-shadow: inset 0 0 0 1px #d85b5b;
}

#newUserNumberHint.manual {
  color: #ad651b;
}

.employee-number-mode {
  display: flex !important;
  min-height: 44px;
  flex-direction: row !important;
  gap: 9px !important;
  align-items: center;
  padding: 9px 11px;
  border: 1px solid #e1e8e4;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.employee-number-mode input {
  width: 16px;
  height: 16px;
  accent-color: #1e684b;
}

.employee-number-mode span {
  display: grid;
  gap: 2px;
}

.employee-number-mode b {
  color: #455b51;
  font-size: 11px;
}

.employee-number-mode small {
  margin: 0 !important;
  color: #98a39d !important;
  font-size: 9px !important;
}

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

.employee-capacity-field {
  grid-column: 1 / -1;
}

.employee-create-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 2px;
}

.employee-create-actions button {
  min-width: 112px;
}

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

@media (max-width: 620px) {
  .team-management-head,
  .team-section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .team-overview,
  .employee-form-grid,
  .employee-number-card {
    grid-template-columns: 1fr;
  }

  .team-overview {
    padding: 0 14px 17px;
  }

  .department-grid {
    padding: 14px;
  }
}

.lead-resizable-table {
  table-layout: fixed;
}

.lead-resizable-table thead th {
  position: relative;
  padding-right: 18px;
}

.lead-resizable-table tbody tr,
.lead-resizable-table tbody td {
  height: auto;
}

.lead-resizable-table tbody td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.lead-resizable-table tbody td > b,
.lead-resizable-table tbody td > small {
  max-width: 100%;
}

.lead-resizable-table .status-drop,
.lead-resizable-table .lead-tag-choose {
  max-width: 100%;
}

.column-resize-handle {
  position: absolute;
  z-index: 4;
  top: 0;
  right: -4px;
  width: 9px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.column-resize-handle::after {
  content: "";
  position: absolute;
  top: 24%;
  bottom: 24%;
  left: 4px;
  width: 1px;
  border-radius: 999px;
  background: #cbd5d0;
  transition: background .15s, width .15s;
}

.column-resize-handle:hover::after,
body.column-resizing .column-resize-handle::after {
  width: 2px;
  background: #17684f;
}

body.column-resizing,
body.column-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

td b {
  color: #26342e;
}

td small {
  color: #89958f;
}

.lead-name,
.lead-name-cell .lead-name {
  color: #173f31 !important;
}

.lead-name:hover,
.lead-name-cell .lead-name:hover {
  color: #1f7657 !important;
  text-decoration: none;
}

.contact a,
.call-link,
.phone-number {
  color: #285d48;
}

.status-drop,
.tag-drop {
  border-color: #dce5e0;
  border-radius: 8px;
  background-color: #fbfcfb;
}

.badge {
  border: 1px solid transparent;
  padding: 5px 9px;
  font-weight: 750;
}

.badge.new {
  border-color: #f0dda6;
  background: #fff7df;
  color: #8b641c;
}

.badge.following {
  border-color: #cfe0f4;
  background: #edf5fd;
  color: #35628f;
}

.badge.pending {
  border-color: #dfd5f1;
  background: #f4effb;
  color: #6a5293;
}

.badge.won {
  border-color: #cce4d2;
  background: #eaf6ed;
  color: #277341;
}

.badge.lost,
.badge.invalid {
  border-color: #dfe4e1;
  background: #f2f4f3;
  color: #6d7772;
}

.leads-source-badge {
  border-radius: 999px;
  padding: 4px 8px;
  font-weight: 650;
}

.leads-source-badge.ocean {
  background: #edf4fb;
  color: #356b9e;
}

.leads-source-badge.douyin {
  background: #f9edf1;
  color: #a74b65;
}

.leads-source-badge.wecom {
  background: #edf7ef;
  color: #37754a;
}

.row-open {
  padding: 6px 8px;
  border-radius: 7px;
  color: var(--green);
}

.row-open:hover {
  background: var(--green-soft);
}

.pager {
  padding: 16px 24px 18px;
}

.pager .ghost {
  height: 35px;
  padding: 0 13px;
}

/* Drawers, dialogs and feedback */

.shade {
  background: rgba(7, 34, 25, 0.48);
  backdrop-filter: blur(3px);
}

.drawer {
  width: min(540px, 100vw);
  padding: 30px;
  box-shadow: -24px 0 80px rgba(11, 43, 32, 0.23);
}

.drawer-head,
.dialog-head {
  border-bottom-color: #e6ece8;
}

.drawer-head h2,
.dialog-head h2 {
  color: #1b2a24;
  letter-spacing: -0.025em;
}

.drawer-head button,
.dialog-head button,
.dialog-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 9px;
  color: #738079;
}

.drawer-head button:hover,
.dialog-head button:hover,
.dialog-close:hover {
  background: #f0f4f2;
  color: #24342d;
}

.detail-grid {
  gap: 11px;
}

.detail-item {
  padding: 13px 14px;
  border: 1px solid #e8eeea;
  border-radius: 11px;
  background: #f8faf9;
}

.timeline article {
  border-left-color: #d6e4dc;
}

.timeline article::before {
  background: #4f8b6f;
  box-shadow: 0 0 0 4px #e8f2ed;
}

dialog {
  overflow: hidden;
  border: 1px solid rgba(223, 231, 226, 0.9);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}

dialog::backdrop {
  background: rgba(7, 34, 25, 0.48);
  backdrop-filter: blur(4px);
}

#batchTagDialog,
#tagEditDialog,
#tagDeleteDialog {
  border-radius: 18px !important;
}

#batchTagDialog .dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 17px;
  border-bottom: 1px solid var(--line);
}

#batchTagDialog .dialog-header h3 {
  margin: 0;
  color: #22322b;
}

.batch-tag-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

.batch-tag-option:hover {
  background: #f2f7f4;
}

.batch-tag-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.toast {
  right: 24px;
  bottom: 24px;
  padding: 13px 17px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  background: #173f31;
  box-shadow: 0 18px 45px rgba(10, 44, 32, 0.24);
}

.empty {
  color: #5f6d66;
}

.empty::before {
  display: block;
  margin-bottom: 12px;
  content: "◇";
  color: #b3c2ba;
  font-size: 28px;
}

/* Supporting modules */

.dept-card {
  border-color: #e2e9e5;
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
}

.dept-card:hover {
  border-color: #c9d8d0;
  box-shadow: 0 12px 28px rgba(22, 55, 43, 0.08);
}

.tag-create-form,
.tag-group {
  border-color: #e3eae6;
  border-radius: 13px;
  box-shadow: none;
}

.tag-badge {
  border-radius: 999px;
  box-shadow: none;
}

/* Tag library */

.tag-library-panel {
  overflow: visible;
  background:
    radial-gradient(circle at 92% 0, rgba(205, 231, 218, 0.28), transparent 260px),
    #fff;
}

.tag-library-header {
  align-items: center;
  padding-bottom: 18px;
}

.tag-library-total {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 88px;
  padding: 10px 14px;
  border: 1px solid #dfe9e3;
  border-radius: 12px;
  background: rgba(247, 250, 248, 0.88);
  color: #718078;
}

.tag-library-total strong {
  color: #173f31;
  font-size: 22px;
  line-height: 1;
}

.tag-library-total span {
  font-size: 12px;
}

.tag-create-form {
  margin: 0 24px 22px;
  padding: 20px;
  border: 1px solid #dfe9e3;
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fbf9 0%, #f3f8f5 100%);
}

.tag-create-main {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 190px auto;
  gap: 12px;
  align-items: end;
}

.tag-form-field {
  display: grid;
  gap: 7px;
  color: #53625a;
  font-size: 12px;
  font-weight: 650;
}

.tag-form-field input,
.tag-form-field select {
  width: 100%;
  height: 44px;
  border: 1px solid #d9e3dd;
  border-radius: 10px;
  background: #fff;
  color: #20362d;
  font-size: 13px;
}

.tag-form-field input:focus,
.tag-form-field select:focus {
  border-color: #699d85;
  box-shadow: 0 0 0 3px rgba(60, 124, 94, 0.11);
  outline: none;
}

.tag-create-submit {
  height: 44px;
  padding-inline: 20px;
  white-space: nowrap;
}

.tag-color-field {
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid #e1e9e4;
}

.tag-color-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: #53625a;
  font-size: 12px;
  font-weight: 650;
}

.tag-color-heading small {
  color: #92a099;
  font-size: 11px;
  font-weight: 400;
}

.tag-color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-color-option.tag-color-blue,
.tag-pill.tag-color-blue,
.lead-tag-pill.tag-color-blue,
.lead-tag-choice-ui.tag-color-blue,
.new-lead-tag-choice .tag-color-blue,
.tag-delete-preview.tag-color-blue {
  --tag-color: #2563eb;
}

.tag-color-option.tag-color-cyan,
.tag-pill.tag-color-cyan,
.lead-tag-pill.tag-color-cyan,
.lead-tag-choice-ui.tag-color-cyan,
.new-lead-tag-choice .tag-color-cyan,
.tag-delete-preview.tag-color-cyan {
  --tag-color: #0891b2;
}

.tag-color-option.tag-color-green,
.tag-pill.tag-color-green,
.lead-tag-pill.tag-color-green,
.lead-tag-choice-ui.tag-color-green,
.new-lead-tag-choice .tag-color-green,
.tag-delete-preview.tag-color-green {
  --tag-color: #16a34a;
}

.tag-color-option.tag-color-amber,
.tag-pill.tag-color-amber,
.lead-tag-pill.tag-color-amber,
.lead-tag-choice-ui.tag-color-amber,
.new-lead-tag-choice .tag-color-amber,
.tag-delete-preview.tag-color-amber {
  --tag-color: #ca8a04;
}

.tag-color-option.tag-color-orange,
.tag-pill.tag-color-orange,
.lead-tag-pill.tag-color-orange,
.lead-tag-choice-ui.tag-color-orange,
.new-lead-tag-choice .tag-color-orange,
.tag-delete-preview.tag-color-orange {
  --tag-color: #ea580c;
}

.tag-color-option.tag-color-red,
.tag-pill.tag-color-red,
.lead-tag-pill.tag-color-red,
.lead-tag-choice-ui.tag-color-red,
.new-lead-tag-choice .tag-color-red,
.tag-delete-preview.tag-color-red {
  --tag-color: #dc2626;
}

.tag-color-option.tag-color-purple,
.tag-pill.tag-color-purple,
.lead-tag-pill.tag-color-purple,
.lead-tag-choice-ui.tag-color-purple,
.new-lead-tag-choice .tag-color-purple,
.tag-delete-preview.tag-color-purple {
  --tag-color: #7c3aed;
}

.tag-color-option {
  --tag-color: #2563eb;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--tag-color) 24%, white);
  border-radius: 999px;
  background: color-mix(in srgb, var(--tag-color) 8%, white);
  color: var(--tag-color);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.15s;
}

.tag-color-option i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--tag-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tag-color) 13%, white);
}

.tag-color-option:hover {
  border-color: color-mix(in srgb, var(--tag-color) 48%, white);
  background: color-mix(in srgb, var(--tag-color) 12%, white);
  transform: translateY(-1px);
}

.tag-color-option.selected {
  border-color: var(--tag-color);
  background: color-mix(in srgb, var(--tag-color) 15%, white);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tag-color) 10%, transparent);
}

.tag-color-option.selected::after {
  content: "✓";
  font-size: 11px;
  font-weight: 800;
}

.tag-groups {
  display: block;
  padding: 0 24px 24px;
}

.system-tag-library,
.platform-reason-library {
  min-width: 0;
}

.system-tag-library-head,
.platform-reason-library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}

.system-tag-library-head h3,
.platform-reason-library-head h3 {
  margin: 0;
  color: #183b2e;
  font-size: 15px;
}

.system-tag-library-head p,
.platform-reason-library-head p {
  margin: 4px 0 0;
  color: #829089;
  font-size: 11px;
}

.system-tag-library-head > span,
.platform-reason-library-head > small {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef4f1;
  color: #547565;
  font-size: 10px;
}

.system-tag-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.platform-reason-library {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid #e4ece7;
}

.platform-reason-library-head > div {
  display: flex;
  align-items: center;
  gap: 11px;
}

.platform-reason-library-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: #e9f4ee;
  color: #207151;
  font-size: 17px;
  font-weight: 800;
}

.platform-reason-platforms {
  display: grid;
  gap: 14px;
}

.platform-reason-platform {
  overflow: hidden;
  border: 1px solid #dfe9e3;
  border-radius: 15px;
  background: #fbfdfc;
}

.platform-reason-platform > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #e5ece8;
  background: #f4f8f6;
}

.platform-reason-platform > header div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.platform-reason-platform > header strong {
  color: #173f31;
  font-size: 13px;
}

.platform-reason-platform > header code,
.platform-reason-platform > header span {
  color: #74857c;
  font-size: 9px;
}

.platform-reason-field-note {
  padding: 11px 16px 0;
  color: #718078;
  font-size: 10px;
}

.platform-reason-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  padding: 12px 16px 16px;
}

.platform-reason-card {
  min-width: 0;
  padding: 11px;
  border: 1px solid #e3ebe7;
  border-radius: 11px;
  background: #fff;
}

.platform-reason-card.positive { border-left: 3px solid #16a34a; }
.platform-reason-card.negative { border-left: 3px solid #dc2626; }
.platform-reason-card.neutral { border-left: 3px solid #2563eb; }
.platform-reason-card.unconfirmed { border-left: 3px solid #ca8a04; }

.platform-reason-card-main {
  display: flex;
  gap: 8px;
}

.platform-reason-card-main > i {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--tag-color);
}

.platform-reason-card-main > div {
  min-width: 0;
}

.platform-reason-card-main b,
.platform-reason-card-main small,
.platform-reason-card-main code {
  display: block;
}

.platform-reason-card-main b {
  overflow: hidden;
  color: #263d34;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-reason-card-main small {
  margin-top: 3px;
  color: #7c8a83;
  font-size: 9px;
}

.platform-reason-card-main code {
  overflow: hidden;
  margin-top: 3px;
  color: #98a39d;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-reason-card > label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  margin-top: 10px;
  color: #78867f;
  font-size: 9px;
}

.platform-reason-card select {
  width: auto;
  min-width: 88px;
  height: 28px;
  padding: 0 24px 0 8px;
  border: 1px solid #dfe7e3;
  border-radius: 7px;
  background-color: #f8faf9;
  color: #3f5e50;
  font-size: 9px;
}

.platform-reason-library-footnote {
  margin: 11px 2px 0;
  color: #819087;
  font-size: 10px;
  line-height: 1.6;
}

.tag-group {
  min-width: 0;
  margin: 0;
  padding: 18px;
  border: 1px solid #e1e9e4;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 7px 20px rgba(22, 55, 43, 0.045);
}

.tag-group-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 17px;
}

.tag-group-identity {
  display: flex;
  min-width: 0;
  gap: 11px;
  align-items: flex-start;
}

.tag-group-create {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #dce7e1;
  border-radius: 8px;
  background: #f8fbf9;
  color: #28664e;
  cursor: pointer;
  font-size: 11px;
  font-weight: 680;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.15s;
}

.tag-group-create:hover {
  border-color: #8bb39f;
  background: #edf7f1;
  color: #174d38;
  transform: translateY(-1px);
}

.tag-group-create:focus-visible {
  outline: 2px solid #3d8164;
  outline-offset: 2px;
}

.tag-group-mark {
  display: grid;
  flex: 0 0 32px;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 750;
}

.tag-group-mark.positive {
  background: #e9f7ee;
  color: #16803c;
}

.tag-group-mark.negative {
  background: #fff0ef;
  color: #c73737;
}

.tag-group-mark.neutral {
  background: #eef3f7;
  color: #5f6f7b;
  font-size: 22px;
  line-height: 1;
}

.tag-group h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 4px;
  color: #263a31;
  font-size: 14px;
  font-weight: 720;
}

.tag-group h3 span {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #eef3f0;
  color: #6f7d76;
  font-size: 11px;
  font-weight: 650;
}

.tag-group-head p {
  margin: 0;
  color: #8a9790;
  font-size: 11px;
  line-height: 1.45;
}

.tag-group-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-pill {
  --tag-color: #2563eb;
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--tag-color) 24%, white);
  border-radius: 999px;
  background: color-mix(in srgb, var(--tag-color) 10%, white);
  color: var(--tag-color);
  transition: border-color 0.16s, box-shadow 0.16s, transform 0.16s;
}

.tag-pill:hover {
  border-color: color-mix(in srgb, var(--tag-color) 48%, white);
  box-shadow: 0 5px 14px color-mix(in srgb, var(--tag-color) 13%, transparent);
  transform: translateY(-1px);
}

.tag-pill-main {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 9px 0 12px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.tag-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tag-color);
}

.tag-del-inline {
  display: grid;
  place-items: center;
  width: 28px;
  min-height: 34px;
  padding: 0 8px 1px 5px;
  border: 0;
  border-left: 1px solid color-mix(in srgb, var(--tag-color) 18%, white);
  background: transparent;
  color: var(--tag-color);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  opacity: 0.48;
  transition: background 0.15s, opacity 0.15s;
}

.tag-del-inline:hover {
  background: color-mix(in srgb, var(--tag-color) 10%, white);
  color: var(--tag-color);
  opacity: 1;
}

.tag-pill-main:focus-visible,
.tag-del-inline:focus-visible,
.tag-color-option:focus-visible {
  outline: 2px solid var(--tag-color);
  outline-offset: 2px;
}

.tag-group-empty {
  display: grid;
  width: 100%;
  min-height: 70px;
  place-content: center;
  padding: 12px;
  border: 1px dashed #dfe7e2;
  border-radius: 11px;
  background: #fafcfb;
  text-align: center;
}

.tag-group-empty span {
  color: #728079;
  font-size: 12px;
  font-weight: 650;
}

.tag-group-empty small {
  margin-top: 4px;
  color: #a0aaa5;
  font-size: 10px;
}

.tag-edit-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid #dce6e0;
  border-radius: 17px;
}

.tag-edit-dialog .dialog-head {
  padding: 19px 22px;
  border-bottom: 1px solid #e8eeea;
  background: #fbfcfb;
}

.tag-edit-dialog .dialog-head h2 {
  margin: 2px 0 0;
  font-size: 18px;
}

.tag-edit-dialog .dialog-head .eyebrow {
  margin: 0;
}

.tag-edit-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 22px;
}

.tag-edit-color-field,
.tag-edit-actions {
  grid-column: 1 / -1;
}

.tag-edit-color-field {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.tag-create-hint {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  color: #8b9791;
  font-size: 11px;
}

.tag-create-hint.ready {
  color: #2b7958;
}

.tag-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 3px;
  padding-top: 17px;
  border-top: 1px solid #e8eeea;
}

.tag-edit-actions button {
  min-width: 88px;
}

.tag-edit-actions .primary:disabled {
  background: #b9c6c0;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.72;
  transform: none;
}

.tag-delete-dialog {
  width: min(500px, calc(100vw - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid #eadfdd;
  border-radius: 17px;
}

.tag-delete-head {
  padding: 19px 22px;
  border-bottom: 1px solid #f0e6e4;
  background: linear-gradient(90deg, #fffafa, #fff);
}

.tag-delete-head h2 {
  margin: 2px 0 0;
  color: #3d2926;
  font-size: 18px;
}

.tag-delete-head .eyebrow {
  margin: 0;
  color: #b85c53;
}

.tag-delete-body {
  display: grid;
  gap: 17px;
  padding: 22px;
}

.tag-delete-warning {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid #f1d4cf;
  border-radius: 12px;
  background: #fff8f6;
}

.tag-delete-warning-icon {
  display: grid;
  flex: 0 0 30px;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #df5549;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 5px 13px rgba(188, 57, 46, 0.2);
}

.tag-delete-warning h3 {
  margin: 0 0 4px;
  color: #5a302b;
  font-size: 14px;
}

.tag-delete-warning p {
  margin: 0;
  color: #96716c;
  font-size: 11px;
  line-height: 1.55;
}

.tag-delete-target {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid #e6ece8;
  border-radius: 11px;
  background: #fafcfb;
}

.tag-delete-target > div {
  display: grid;
  gap: 3px;
}

.tag-delete-target > div > span {
  color: #4a5e55;
  font-size: 12px;
  font-weight: 680;
}

.tag-delete-target small {
  color: #929e98;
  font-size: 10px;
}

.tag-delete-preview {
  --tag-color: #2563eb;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 58%;
  padding: 7px 11px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--tag-color) 24%, white);
  border-radius: 999px;
  background: color-mix(in srgb, var(--tag-color) 10%, white);
  color: var(--tag-color);
  white-space: nowrap;
}

.tag-delete-preview i {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tag-color);
}

.tag-delete-preview strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
}

.tag-replace-field {
  display: grid;
  gap: 7px;
}

.tag-replace-field > span {
  color: #4b5c54;
  font-size: 12px;
  font-weight: 680;
}

.tag-replace-field em {
  margin-left: 4px;
  padding: 2px 5px;
  border-radius: 5px;
  background: #fff0ee;
  color: #c54f45;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
}

.tag-replace-field select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #dce4df;
  border-radius: 10px;
  background: #fff;
  color: #263a31;
  font-size: 13px;
}

.tag-replace-field select:focus {
  border-color: #c77970;
  box-shadow: 0 0 0 3px rgba(196, 94, 82, 0.1);
  outline: none;
}

.tag-replace-field small {
  color: #8e9a94;
  font-size: 10px;
}

.tag-replace-field small.selected {
  color: #3d7b5f;
}

.tag-replace-field small.error {
  color: #c74e45;
}

.tag-delete-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 16px 22px 20px;
  border-top: 1px solid #eee8e6;
  background: #fdfcfc;
}

.tag-delete-actions button {
  min-width: 94px;
}

.tag-danger-button {
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 9px;
  background: #d94d43;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 680;
  box-shadow: 0 7px 16px rgba(193, 58, 48, 0.18);
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}

.tag-danger-button:hover {
  background: #c94137;
  box-shadow: 0 9px 19px rgba(193, 58, 48, 0.23);
  transform: translateY(-1px);
}

.tag-danger-button:disabled {
  background: #d9c8c5;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.72;
  transform: none;
}

.lead-tags-cell {
  min-width: 158px;
}

.lead-tag-choose {
  height: 31px;
  padding: 0 11px;
  border: 1px solid #cfdcd5;
  border-radius: 8px;
  background: #f8fbf9;
  color: #245f48;
  cursor: pointer;
  font-size: 11px;
  font-weight: 680;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.15s;
}

.lead-tag-choose::before {
  margin-right: 5px;
  content: "+";
  font-size: 13px;
  font-weight: 800;
}

.lead-tag-choose:hover {
  border-color: #78a58f;
  background: #edf7f1;
  box-shadow: 0 4px 11px rgba(28, 92, 66, 0.09);
  transform: translateY(-1px);
}

.lead-tag-choose:focus-visible {
  outline: 2px solid #3d8164;
  outline-offset: 2px;
}

.lead-tag-current {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 5px;
}

.lead-tag-none {
  color: #99a49e;
  font-size: 10px;
}

.lead-tag-dialog {
  width: min(580px, calc(100vw - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid #dce6e0;
  border-radius: 17px;
}

.lead-tag-dialog .dialog-head {
  padding: 19px 22px;
  border-bottom: 1px solid #e6ede9;
  background: linear-gradient(90deg, #f9fcfa, #fff);
}

.lead-tag-dialog .dialog-head h2 {
  margin: 2px 0 0;
  font-size: 18px;
}

.lead-tag-dialog .dialog-head .eyebrow {
  margin: 0;
}

.lead-tag-dialog .dialog-head small {
  display: block;
  max-width: 390px;
  margin-top: 5px;
  overflow: hidden;
  color: #829089;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-tag-picker-body {
  max-height: min(60vh, 520px);
  padding: 20px 22px;
  overflow-y: auto;
}

.lead-tag-picker-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
  padding: 10px 12px;
  border: 1px solid #e4ebe7;
  border-radius: 10px;
  background: #f8fbf9;
  color: #596a61;
  font-size: 11px;
}

.lead-tag-picker-summary > div {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lead-tag-picker-summary strong {
  color: #1f694e;
  font-size: 16px;
}

.lead-tag-picker-summary button {
  margin-left: 7px;
  padding: 3px 7px;
  border: 0;
  border-radius: 6px;
  background: #e8f1ec;
  color: #40705b;
  cursor: pointer;
  font-size: 10px;
}

.lead-tag-picker-summary button:hover {
  background: #dcebe3;
}

.lead-tag-picker-summary button:disabled {
  cursor: default;
  opacity: 0.42;
}

.lead-tag-option-groups {
  display: grid;
  gap: 13px;
}

.lead-tag-option-group {
  padding: 14px;
  border: 1px solid #e3eae6;
  border-radius: 12px;
  background: #fff;
}

.lead-tag-option-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 11px;
}

.lead-tag-option-head .tag-group-mark {
  flex-basis: 26px;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 14px;
}

.lead-tag-option-head strong {
  color: #35483f;
  font-size: 12px;
}

.lead-tag-option-head small {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #eff3f1;
  color: #76827c;
  font-size: 10px;
}

.lead-tag-choice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lead-tag-choice {
  position: relative;
  cursor: pointer;
}

.lead-tag-choice-input,
.platform-reason-choice-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.lead-tag-choice-ui {
  --tag-color: #2563eb;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px 0 9px;
  border: 1px solid color-mix(in srgb, var(--tag-color) 22%, white);
  border-radius: 999px;
  background: color-mix(in srgb, var(--tag-color) 7%, white);
  color: var(--tag-color);
  font-size: 11px;
  font-weight: 650;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.15s;
}

.lead-tag-choice-ui > i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tag-color);
}

.lead-tag-choice-check {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid color-mix(in srgb, var(--tag-color) 28%, white);
  border-radius: 50%;
  color: transparent;
  font-size: 10px;
  font-weight: 800;
}

.lead-tag-choice:hover .lead-tag-choice-ui {
  border-color: color-mix(in srgb, var(--tag-color) 45%, white);
  background: color-mix(in srgb, var(--tag-color) 11%, white);
  transform: translateY(-1px);
}

.lead-tag-choice-input:focus-visible + .lead-tag-choice-ui,
.platform-reason-choice-input:focus-visible + .lead-tag-choice-ui {
  outline: 2px solid var(--tag-color);
  outline-offset: 2px;
}

.lead-tag-choice-input:checked + .lead-tag-choice-ui,
.platform-reason-choice-input:checked + .lead-tag-choice-ui {
  border-color: var(--tag-color);
  background: color-mix(in srgb, var(--tag-color) 15%, white);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tag-color) 9%, transparent);
}

.lead-tag-choice-input:checked + .lead-tag-choice-ui .lead-tag-choice-check,
.platform-reason-choice-input:checked + .lead-tag-choice-ui .lead-tag-choice-check {
  border-color: var(--tag-color);
  background: var(--tag-color);
  color: #fff;
}

.lead-tag-picker-empty {
  padding: 34px 16px;
  border: 1px dashed #dce5e0;
  border-radius: 12px;
  color: #8b9791;
  text-align: center;
  font-size: 12px;
}

.lead-tag-picker-empty.compact {
  padding: 16px 12px;
}

.platform-reason-options {
  border-color: #cfdfd7;
  background: linear-gradient(145deg, #fbfdfc, #f4f9f6);
}

.platform-reason-context {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.platform-reason-context > span {
  padding: 4px 7px;
  border-radius: 999px;
  background: #1c6b4e;
  color: #fff;
  font-size: 9px;
}

.platform-reason-context strong {
  color: #173f31;
  font-size: 13px;
}

.platform-reason-context small {
  margin-left: auto;
  color: #74857c;
  font-size: 9px;
}

.platform-reason-picker-group + .platform-reason-picker-group {
  margin-top: 12px;
}

.platform-reason-picker-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  color: #52665c;
  font-size: 10px;
}

.platform-reason-picker-title span {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #e8efeb;
  text-align: center;
}

.platform-reason-choice .lead-tag-choice-ui {
  min-height: 38px;
  flex-wrap: wrap;
}

.platform-reason-choice .lead-tag-choice-ui em {
  display: block;
  width: 100%;
  margin-left: 24px;
  color: color-mix(in srgb, var(--tag-color) 72%, #52665c);
  font-size: 8px;
  font-style: normal;
  font-weight: 500;
}

.platform-reason-note {
  margin: 12px 0 0;
  color: #7d8d84;
  font-size: 9px;
  line-height: 1.5;
}

.lead-tag-picker-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 16px 22px 20px;
  border-top: 1px solid #e6ede9;
  background: #fbfcfb;
}

.lead-tag-picker-actions button {
  min-width: 94px;
}

.lead-tag-pill {
  display: inline-block;
  margin: 1px;
  padding: 2px 7px;
  border: 1px solid color-mix(in srgb, var(--tag-color) 21%, white);
  border-radius: 999px;
  background: color-mix(in srgb, var(--tag-color) 9%, white);
  color: var(--tag-color);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.lead-tag-pill.laike-synced {
  border-style: dashed;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tag-color) 5%, transparent);
}

.lead-tag-pill.laike-synced i {
  margin-left: 4px;
  padding-left: 4px;
  border-left: 1px solid color-mix(in srgb, var(--tag-color) 24%, transparent);
  font-size: 8px;
  font-style: normal;
  opacity: 0.78;
}

.lead-tag-pill.platform-reason-pill {
  border-style: solid;
}

.lead-tag-pill.platform-reason-pill i {
  margin-left: 4px;
  padding-left: 4px;
  border-left: 1px solid color-mix(in srgb, var(--tag-color) 24%, transparent);
  font-size: 8px;
  font-style: normal;
  opacity: 0.78;
}

.lead-tag-synced {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #e5ebe7;
  border-radius: 12px;
  background: #f7faf8;
}

.lead-tag-synced strong,
.lead-tag-synced small {
  display: block;
}

.lead-tag-synced > div,
.lead-tag-synced section > div {
  margin: 8px 0 6px;
}

.lead-tag-synced section + section {
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid #e4ebe7;
}

.lead-tag-synced small {
  color: #819087;
  font-size: 10px;
}

.lead-stage-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.lead-stage {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 9px;
  border: 1px solid #dce6e1;
  border-radius: 999px;
  background: #f4f7f5;
  color: #486157;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.lead-stage.stage-0 { background:#eff4f1; color:#52655d; }
.lead-stage.stage-1 { border-color:#b9ddcf; background:#e8f6f0; color:#08724d; }
.lead-stage.stage-2 { border-color:#b9d98c; background:#eff8dd; color:#466e0c; }
.lead-stage.stage-3 { border-color:#efc6c6; background:#fff0f0; color:#b02f2f; }
.lead-stage.stage-6 { border-color:#b9d8f4; background:#edf7ff; color:#1768a6; }
.lead-stage.stage-7 { border-color:#ead7a0; background:#fff8df; color:#8b6510; }
.lead-stage.stage-204 { border-color:#cfc5ee; background:#f4f0ff; color:#6944b0; }
.lead-stage.stage-901 { border-color:#f0c8a9; background:#fff2e8; color:#aa4f0d; }

.stage-source-note,
.stage-form-note {
  color: #7b8d84;
  font-size: 9px;
  font-weight: 650;
}

.follow-form select:disabled {
  cursor: not-allowed;
  border-color: #dfe7e2;
  background: #f2f5f3;
  color: #607168;
  opacity: 1;
}

/* Manual lead creation, relationship lineage and follow-up records */

.new-lead-dialog {
  width: min(960px, calc(100vw - 40px));
  height: min(880px, calc(100dvh - 40px));
  max-width: 960px;
  max-height: min(880px, calc(100dvh - 40px));
  padding: 0;
  overflow: hidden;
  border: 1px solid #dce7e1;
  border-radius: 22px;
  background: #f6f9f7;
  box-shadow: 0 30px 90px rgba(13, 47, 35, .24);
}

.new-lead-dialog[open] {
  display: flex;
  flex-direction: column;
}

.new-lead-head {
  position: relative;
  z-index: 4;
  top: 0;
  flex: 0 0 auto;
  margin: 0;
  padding: 20px 25px;
  border-bottom: 1px solid #e0e8e4;
  background:
    radial-gradient(circle at 88% 0, rgba(209, 238, 122, .26), transparent 34%),
    linear-gradient(135deg, #fff 0%, #f4f9f6 100%);
}

.new-lead-head h2 {
  margin: 2px 0 3px;
  color: #173d30;
  font-size: 24px;
}

.new-lead-head small {
  color: #74847c;
}

.new-lead-form {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.new-lead-scroll {
  min-height: 0;
  flex: 1 1 auto;
  padding: 20px 24px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.new-lead-section {
  margin-bottom: 14px;
  padding: 19px 20px 21px;
  border: 1px solid #e0e8e4;
  border-radius: 17px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 24px rgba(21, 56, 43, .045);
}

.new-lead-section-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 16px;
}

.new-lead-section-head > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex: 0 0 34px;
  border: 1px solid #cae1d6;
  border-radius: 11px;
  background: #edf7f1;
  color: #17684f;
  font-size: 11px;
  font-weight: 850;
}

.new-lead-section-head h3,
.new-lead-section-head small {
  display: block;
  margin: 0;
}

.new-lead-section-head h3 {
  color: #223a30;
  font-size: 15px;
}

.new-lead-section-head small {
  margin-top: 3px;
  color: #829088;
  font-size: 10px;
}

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

.new-lead-grid label,
.new-lead-tags {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  color: #53665d;
  font-size: 11px;
  font-weight: 720;
}

.new-lead-grid label > small {
  margin-top: -3px;
  color: #8a9991;
  font-size: 9px;
  font-weight: 520;
}

.new-lead-grid input,
.new-lead-grid select,
.new-lead-grid textarea {
  width: 100%;
  border-color: #dbe5e0;
  border-radius: 10px;
  background: #fbfdfc;
}

.new-lead-grid input,
.new-lead-grid select {
  height: 40px;
}

.new-lead-grid textarea {
  min-height: 80px;
  resize: vertical;
}

.new-lead-grid input[readonly],
.new-lead-grid select:disabled {
  cursor: not-allowed;
  background: #f0f4f2;
  color: #64766d;
  opacity: 1;
}

.new-lead-grid .field-wide {
  grid-column: 1 / -1;
}

.new-autocomplete-field {
  z-index: 7;
}

.new-autocomplete-options {
  position: absolute;
  z-index: 24;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  max-height: 230px;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid #d6e4dd;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(17, 55, 40, .18);
}

.new-autocomplete-option {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #294a3d;
  text-align: left;
}

.new-autocomplete-option:hover,
.new-autocomplete-option:focus {
  background: #edf7f2;
  outline: none;
}

.new-autocomplete-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 720;
}

.new-autocomplete-option small {
  flex: 0 0 auto;
  color: #899890;
  font-size: 9px;
  font-weight: 520;
}

.new-autocomplete-empty {
  margin: 0;
  padding: 13px 10px;
  color: #829088;
  text-align: center;
  font-size: 10px;
  font-weight: 520;
}

.relation-search-field {
  z-index: 3;
}

.relation-search-results {
  position: absolute;
  z-index: 18;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  max-height: 248px;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid #dce7e1;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(17, 55, 40, .16);
}

.relation-search-results > p {
  margin: 0;
  padding: 17px;
  color: #7d8c84;
  text-align: center;
  font-size: 11px;
}

.relation-result {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) minmax(170px, .8fr);
  gap: 14px;
  padding: 11px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #41554b;
  text-align: left;
}

.relation-result:hover {
  background: #eef6f1;
}

.relation-result span,
.relation-result b,
.relation-result small {
  display: block;
  min-width: 0;
}

.relation-result span:last-child {
  text-align: right;
}

.relation-result small {
  margin-top: 3px;
  overflow: hidden;
  color: #819087;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.new-related-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  padding: 13px 14px;
  border: 1px solid #bcdccd;
  border-radius: 13px;
  background: linear-gradient(135deg, #edf8f2, #f8fbf9);
}

.new-related-card span,
.new-related-card b,
.new-related-card small {
  display: block;
}

.new-related-card span {
  margin-bottom: 3px;
  color: #73877d;
  font-size: 9px;
}

.new-related-card b {
  color: #20513e;
  font-size: 12px;
}

.new-related-card small {
  margin-top: 3px;
  color: #7c8d84;
  font-size: 9px;
}

.new-related-card button {
  padding: 7px 10px;
  border: 1px solid #d5e3dc;
  border-radius: 8px;
  background: #fff;
  color: #6d7d75;
  font-size: 10px;
}

.new-duplicate-hint {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, .8fr);
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #efd59e;
  border-radius: 12px;
  background: #fffae9;
  color: #715817;
}

.new-duplicate-hint b,
.new-duplicate-hint small {
  display: block;
}

.new-duplicate-hint small {
  margin-top: 3px;
  opacity: .72;
}

.new-duplicate-hint p {
  margin: 0;
  text-align: right;
  font-size: 10px;
}

.new-lead-tags > span {
  margin-bottom: 1px;
}

#newLeadTagOptions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.new-lead-tag-choice {
  display: block !important;
  cursor: pointer;
}

.new-lead-tag-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.new-lead-tag-choice span {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid color-mix(in srgb, var(--tag-color, #17684f) 20%, white);
  border-radius: 999px;
  background: color-mix(in srgb, var(--tag-color, #17684f) 7%, white);
  color: var(--tag-color, #17684f);
  font-size: 10px;
}

.new-lead-tag-choice span i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.new-lead-tag-choice input:checked + span {
  border-color: currentColor;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tag-color, #17684f) 13%, transparent);
  font-weight: 800;
}

.new-lead-actions {
  position: relative;
  z-index: 4;
  flex: 0 0 auto;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 14px 24px 18px;
  border-top: 1px solid #dfe8e3;
  background: rgba(250, 252, 251, .95);
  box-shadow: 0 -12px 24px rgba(20, 51, 40, .05);
  backdrop-filter: blur(9px);
}

.new-lead-actions > div {
  display: flex;
  gap: 8px;
}

.new-lead-actions .error {
  margin: 0;
}

.lead-relation-cell small {
  display: block;
  margin-top: 4px;
  color: #88968f;
  font-size: 9px;
}

.lead-writeback-cell {
  vertical-align: top;
}

.lead-writeback-status {
  display: grid;
  justify-items: start;
  gap: 4px;
  min-width: 0;
}

.lead-writeback-status > span {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 9px;
  border: 1px solid #dfe7e3;
  border-radius: 999px;
  background: #f2f5f3;
  color: #66756e;
  font-size: 10px;
  font-weight: 760;
  white-space: nowrap;
}

.lead-writeback-status.success > span {
  border-color: #bfe0cd;
  background: #eaf7ef;
  color: #187044;
}

.lead-writeback-status.failed > span {
  border-color: #f0c4c0;
  background: #fff0ee;
  color: #b33f35;
}

.lead-writeback-status > small {
  display: -webkit-box;
  overflow: hidden;
  max-width: 100%;
  color: #87938d;
  font-size: 9px;
  line-height: 1.45;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.lead-writeback-status.success > small {
  color: #56826b;
}

.lead-writeback-status.failed > small {
  color: #a5635d;
}

.lead-writeback-status .writeback-troubleshooting {
  color: #8d6753;
}

.relation-pill {
  display: inline-flex;
  padding: 4px 8px;
  border: 1px solid #c9dcd3;
  border-radius: 999px;
  background: #edf6f1;
  color: #27634c;
  font-size: 10px;
  font-weight: 780;
  white-space: nowrap;
}

.relation-pill.relation-SAME_COMPANY_SAME_PURCHASE {
  border-color: #bbd8e7;
  background: #edf7fc;
  color: #287092;
}

.relation-pill.relation-SAME_COMPANY_NEW_DEMAND {
  border-color: #d8caef;
  background: #f6f1ff;
  color: #754ab2;
}

.relation-pill.relation-REFERRAL {
  border-color: #ead49c;
  background: #fff8e3;
  color: #906817;
}

.followup-cell {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.followup-latest {
  display: block;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #35483f;
  text-align: left;
}

.followup-latest > span,
.followup-latest > small {
  display: block;
}

.followup-latest > span {
  overflow: hidden;
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.followup-latest > small {
  margin-top: 3px;
  overflow: hidden;
  color: #8b9791;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.followup-latest.empty {
  color: #9aa59f;
  font-size: 10px;
}

.quick-followup-row {
  display: flex;
  min-width: 0;
  gap: 5px;
}

.quick-followup-row input {
  width: 100%;
  min-width: 72px;
  height: 28px;
  padding: 4px 7px;
  border-color: #e1e8e4;
  border-radius: 7px;
  background: #fafcfb;
  font-size: 9px;
}

.quick-followup-row button {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid #cfe0d7;
  border-radius: 7px;
  background: #edf6f1;
  color: #27644d;
  font-size: 9px;
  font-weight: 750;
}

.lead-followup-popover {
  position: fixed;
  z-index: 1000;
  width: min(378px, calc(100vw - 24px));
  max-height: 420px;
  overflow: hidden;
  border: 1px solid #dce6e1;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 22px 58px rgba(14, 46, 34, .23);
}

.followup-popover-loading {
  padding: 25px;
  color: #75857d;
  text-align: center;
  font-size: 11px;
}

.followup-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid #e4ebe7;
  background: linear-gradient(135deg, #f4faf6, #fbfdfc);
}

.followup-popover-head b,
.followup-popover-head small {
  display: block;
}

.followup-popover-head b {
  color: #224437;
  font-size: 12px;
}

.followup-popover-head small {
  margin-top: 2px;
  color: #84928b;
  font-size: 9px;
}

.followup-popover-head button {
  padding: 6px 9px;
  border: 1px solid #cfe0d8;
  border-radius: 8px;
  background: #fff;
  color: #27654d;
  font-size: 9px;
}

.followup-popover-list {
  max-height: 348px;
  padding: 7px 13px 13px;
  overflow-y: auto;
}

.followup-popover-list article {
  padding: 10px 2px;
  border-bottom: 1px solid #edf1ef;
}

.followup-popover-list article:last-child {
  border-bottom: 0;
}

.followup-popover-list article > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.followup-popover-list article b {
  color: #345047;
  font-size: 10px;
}

.followup-popover-list article small {
  color: #929e98;
  font-size: 8px;
}

.followup-popover-list article p {
  margin: 7px 0 6px;
  color: #43564d;
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.followup-popover-list footer,
.timeline-manage {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.followup-popover-list footer button,
.timeline-manage button {
  padding: 2px 3px;
  border: 0;
  background: transparent;
  color: #73847b;
  font-size: 9px;
}

.followup-popover-list footer .followup-delete-btn,
.timeline-manage .detail-followup-delete {
  color: #bd5959;
}

.followup-manage-dialog {
  width: min(480px, calc(100vw - 32px));
  border-radius: 18px;
}

.followup-delete-body {
  padding: 4px 4px 2px;
}

.followup-delete-body > p {
  color: #586a61;
  font-size: 12px;
  line-height: 1.65;
}

.followup-delete-body blockquote {
  margin: 14px 0 18px;
  padding: 13px 14px;
  border: 1px solid #eadede;
  border-left: 3px solid #d77a7a;
  border-radius: 10px;
  background: #fff7f7;
  color: #765858;
  font-size: 11px;
  line-height: 1.55;
}

.followup-delete-body > div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

button.danger {
  border: 1px solid #c95d5d;
  background: #bc4b4b;
  color: #fff;
}

button.danger:hover {
  background: #a93f3f;
}

@media (max-width: 1100px) {
  .system-tag-groups {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .tag-library-header {
    align-items: flex-start;
  }

  .tag-library-total {
    min-width: auto;
    padding: 8px 11px;
  }

  .tag-create-form {
    margin: 0 12px 16px;
    padding: 15px;
  }

  .tag-create-main {
    grid-template-columns: 1fr;
  }

  .tag-create-submit {
    width: 100%;
  }

  .tag-color-option {
    flex: 1 0 calc(33.333% - 8px);
    justify-content: center;
    padding-inline: 8px;
  }

  .tag-groups {
    gap: 10px;
    padding: 0 12px 16px;
  }

  .system-tag-groups,
  .platform-reason-card-grid {
    grid-template-columns: 1fr;
  }

  .system-tag-library-head,
  .platform-reason-library-head,
  .platform-reason-context {
    align-items: flex-start;
    flex-direction: column;
  }

  .platform-reason-context small {
    margin-left: 0;
  }

  .platform-reason-platform > header {
    align-items: flex-start;
  }

  .tag-group {
    padding: 15px;
  }

  .tag-group-head {
    align-items: center;
  }

  .tag-group-head p {
    display: none;
  }

  .tag-group-create {
    height: 32px;
  }

  .tag-edit-form {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px;
  }

  .tag-edit-color-field,
  .tag-edit-actions,
  .tag-create-hint {
    grid-column: auto;
  }

  .tag-delete-body {
    padding: 18px;
  }

  .tag-delete-target {
    align-items: flex-start;
    flex-direction: column;
  }

  .tag-delete-preview {
    max-width: 100%;
  }

  .tag-delete-actions {
    padding: 14px 18px 18px;
  }

  .tag-delete-actions button {
    flex: 1;
  }

  .lead-tag-dialog .dialog-head {
    padding: 17px 18px;
  }

  .lead-tag-picker-body {
    max-height: 58vh;
    padding: 16px 18px;
  }

  .lead-tag-picker-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .lead-tag-option-group {
    padding: 12px;
  }

  .lead-tag-picker-actions {
    padding: 14px 18px 18px;
  }

  .lead-tag-picker-actions button {
    flex: 1;
  }

  .new-lead-dialog {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
  }

  .new-lead-form {
    padding: 0;
  }

  .new-lead-scroll {
    padding: 14px 13px 0;
  }

  .new-lead-head {
    padding: 16px 17px;
  }

  .new-lead-section {
    padding: 15px;
  }

  .new-lead-grid {
    grid-template-columns: 1fr;
  }

  .new-lead-grid .field-wide {
    grid-column: auto;
  }

  .relation-result {
    grid-template-columns: 1fr;
  }

  .relation-result span:last-child {
    text-align: left;
  }

  .new-related-card {
    grid-template-columns: 1fr auto;
  }

  .new-related-card > div:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .new-related-card button {
    grid-column: 2;
    grid-row: 1;
  }

  .new-duplicate-hint {
    grid-template-columns: 1fr;
  }

  .new-duplicate-hint p {
    text-align: left;
  }

  .new-lead-actions {
    align-items: stretch;
    flex-direction: column;
    margin: 0;
    padding: 12px 13px 14px;
  }

  .new-lead-actions > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .new-lead-actions #saveLeadSubmit {
    grid-column: 1 / -1;
  }
}

.row-menu,
.laike-popup,
.phone-actions,
.tag-select-popup {
  border-color: #e0e8e3;
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(18, 52, 40, 0.14);
}

.docs-layout {
  border: 1px solid #e2e9e5;
  border-radius: 15px;
  box-shadow: var(--shadow-md);
}

.docs-sidebar {
  border-right-color: #e5ebe7;
}

.docs-tree-item.active {
  border-left-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.docs-new-btn:hover,
.docs-action-btn:hover,
.docs-inline-btn {
  border-color: #69a187;
  color: var(--green);
}

/* Responsive */

@media (max-width: 1280px) {
  .app {
    grid-template-columns: 226px minmax(0, 1fr);
  }

  .app > aside {
    width: 226px;
  }

  main {
    padding-right: 24px;
    padding-left: 24px;
  }

  .app > main > header {
    margin-right: -24px;
    margin-left: -24px;
    padding-right: 24px;
    padding-left: 24px;
  }

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

  .filters .search-box {
    flex-basis: 100%;
  }
}

@media (max-width: 980px) {
  .app > main > header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .head-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .user {
    margin-left: auto;
  }

  .filters select {
    flex: 1 1 128px;
  }
}

@media (max-width: 760px) {
  .app.hidden {
    display: none !important;
  }

  .auth-shell {
    padding: 16px;
  }

  .auth-card {
    padding: 34px 26px;
    border-radius: 22px;
  }

  .auth-card h1 {
    font-size: 27px;
  }

  .app {
    display: block !important;
  }

  .app > aside {
    width: min(284px, 84vw);
    padding-top: 22px;
  }

  main {
    padding: 15px 10px 36px;
  }

  .app > main > header {
    position: relative;
    top: auto;
    gap: 10px;
    margin: -15px -10px 14px;
    padding: 15px 10px 14px 58px;
    background: rgba(243, 246, 244, 0.96);
  }

  .app > main > header h1 {
    font-size: 21px;
  }

  .head-actions {
    gap: 6px;
    margin-left: -48px;
  }

  .head-actions .ghost,
  .head-actions .primary.small {
    height: 34px;
    padding: 0 9px;
  }

  .user {
    margin-left: 0;
    padding-left: 5px;
  }

  .menu-toggle {
    border-color: #d7e1dc;
    box-shadow: 0 7px 18px rgba(21, 55, 43, 0.1);
  }

  .stats {
    display: flex;
    gap: 9px;
    margin-right: -10px;
    padding-right: 10px;
  }

  .data-range-bar {
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
    margin: 0 0 12px;
    padding: 8px 9px;
  }

  .data-range-caption small {
    max-width: 150px;
  }

  .data-range-control > span {
    display: none;
  }

  #dataRange {
    width: 118px;
  }

  .custom-range-fields {
    width: 100%;
    padding: 8px 0 0;
    border-top: 1px solid #e1e8e4;
    border-left: 0;
  }

  .custom-range-fields label {
    flex: 1;
  }

  .custom-range-fields input {
    width: 100%;
  }

  .stats article {
    min-width: 146px;
    min-height: 112px;
    padding: 15px;
  }

  .panel {
    border-radius: 15px;
  }

  .panel-top {
    padding: 15px 13px 8px;
  }

  .filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    padding: 10px 12px 14px;
  }

  .filters .search-box {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .filters input,
  .filters select,
  .filters input[type="date"],
  .filters button,
  .leads-export {
    width: 100% !important;
    min-width: 0;
    height: 37px !important;
  }

  .batch-bar {
    margin: 0 12px 10px;
  }

  .leads-table-wrap {
    max-height: none;
    margin: 0 10px;
    border: 0;
    background: transparent;
  }

  .table-wrap {
    border-top: 0;
    background: transparent;
  }

  tbody tr {
    overflow: hidden;
    border-color: #e1e8e4;
    border-radius: 13px;
    box-shadow: 0 5px 16px rgba(20, 49, 38, 0.04);
  }

  tbody tr:hover td {
    background: #fff;
  }

  td {
    min-height: 37px;
    border-bottom-color: #edf1ef;
  }

  .pager {
    gap: 10px;
    padding: 12px;
  }

  .drawer {
    padding: 20px 17px;
  }

  dialog {
    width: calc(100vw - 20px) !important;
    border-radius: 16px;
  }

  .toast {
    right: 10px;
    bottom: 10px;
    left: 10px;
  }
}

@media (max-width: 760px) {
  .column-resize-handle {
    display: none;
  }

  .lead-resizable-table {
    width: 100% !important;
    table-layout: auto;
  }
}

@media (max-width: 560px) {
  .site-compliance-footer {
    gap: 3px 6px;
    font-size: 10px;
  }

  .site-compliance-separator {
    display: none;
  }

  .site-compliance-footer span,
  .site-compliance-footer a {
    flex-basis: 100%;
  }

  .auth-compliance-footer {
    right: 12px;
    bottom: 10px;
    left: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
