/* AutoImport CRM — интерфейс в стиле amoCRM */
:root {
  --navy-950: #0b1428;
  --navy-900: #101b34;
  --navy-800: #162341;
  --navy-700: #1d2c4f;
  --navy-600: #26375e;
  --accent: #2f80ed;
  --accent-600: #1b6fd8;
  --accent-soft: #eaf2ff;
  --bg: #f2f5fa;
  --card: #ffffff;
  --text: #1d2740;
  --text-soft: #46536c;
  --muted: #7d8aa1;
  --border: #e4e9f1;
  --border-strong: #d5dce8;
  --success: #1aa874;
  --success-soft: #e6f8f1;
  --warning: #e89a2b;
  --warning-soft: #fff4e2;
  --danger: #df5b64;
  --danger-soft: #fdecef;
  --violet: #7b61ff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(19, 33, 68, .04), 0 8px 24px rgba(19, 33, 68, .04);
  --shadow-lg: 0 22px 50px rgba(13, 27, 58, .16);
  --sidebar-width: 260px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, dl, dd, dt { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-600); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.spacer { flex: 1; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
::selection { background: rgba(47, 128, 237, .2); }

/* ---------- Layout ---------- */
.app-layout { display: flex; min-height: 100vh; }
.main-shell { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { flex: 1; padding: 24px 28px 56px; width: 100%; max-width: 1680px; margin: 0 auto; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  color: #cbd5e7;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(47, 128, 237, .18), transparent 55%),
    linear-gradient(180deg, var(--navy-900) 0%, var(--navy-950) 100%);
  border-right: 1px solid rgba(255, 255, 255, .04);
  z-index: 40;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 22px 22px 18px;
  color: #fff;
}
.sidebar-brand:hover { color: #fff; }
.brand-mark {
  width: 34px; height: 34px;
  display: inline-grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(145deg, #4b9bff, var(--accent-600));
  box-shadow: 0 6px 18px rgba(47, 128, 237, .38), inset 0 1px 0 rgba(255,255,255,.35);
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -.02em;
  flex: 0 0 auto;
}
.brand-mark-lg { width: 42px; height: 42px; border-radius: 12px; font-size: 21px; }
.brand-text {
  font-size: 13px; font-weight: 400; letter-spacing: .16em; line-height: 1;
  color: #dce6f8; display: flex; align-items: baseline; gap: 2px;
}
.brand-text strong { font-weight: 800; color: #fff; letter-spacing: .12em; }
.brand-text small { font-size: 9px; letter-spacing: .28em; color: #6f86ad; margin-left: 4px; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 4px 12px 12px; scrollbar-width: thin; }
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }
.sidebar-section { margin-top: 18px; }
.sidebar-label {
  display: block; padding: 0 12px 8px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: #62779e;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  border-radius: 9px;
  color: #aebbd4;
  font-size: 13px;
  font-weight: 500;
  transition: background .16s, color .16s, transform .16s;
  position: relative;
}
.nav-item svg { width: 18px; height: 18px; opacity: .85; flex: 0 0 18px; }
.nav-item:hover { background: rgba(255,255,255,.055); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(47,128,237,.95), rgba(47,128,237,.72));
  color: #fff;
  box-shadow: 0 6px 18px rgba(23, 94, 190, .28);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px;
  width: 3px; border-radius: 0 3px 3px 0; background: #7db4ff;
}
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 12px;
  display: flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,.12);
}
.sidebar-user {
  display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0;
  padding: 6px; border-radius: 9px; color: #dce5f4;
}
.sidebar-user:hover { background: rgba(255,255,255,.05); color: #fff; }
.sidebar-user-info { display: flex; flex-direction: column; min-width: 0; }
.sidebar-user-info strong { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info small { font-size: 10.5px; color: #7e90ae; }
.sidebar-logout {
  background: transparent; border: 0; color: #7e90ae; padding: 8px; border-radius: 8px;
}
.sidebar-logout:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-logout svg { width: 17px; height: 17px; }

/* ---------- Topbar ---------- */
.topbar {
  height: 72px;
  flex: 0 0 72px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar h1 { font-size: 19px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.topbar p { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.btn-new-lead svg { width: 15px; height: 15px; }
.notification-btn { position: relative; }
.notification-badge {
  position: absolute; top: -3px; right: -3px;
  min-width: 17px; height: 17px; padding: 0 4px;
  display: grid; place-items: center;
  border-radius: 20px;
  background: var(--danger); color: #fff;
  font-size: 9.5px; font-weight: 700;
  border: 2px solid #fff;
}
.topbar-user {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px 4px 4px; border-radius: 30px;
  color: var(--text);
}
.topbar-user:hover { background: #f1f5fb; color: var(--text); }
.topbar-user-name { font-size: 12.5px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-menu { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 12.5px; font-weight: 600;
  line-height: 1; white-space: nowrap;
  transition: background .16s, border-color .16s, box-shadow .16s, color .16s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; flex: 0 0 15px; }
.btn-primary {
  background: linear-gradient(180deg, #3d8cf4, var(--accent));
  color: #fff;
  box-shadow: 0 5px 14px rgba(47, 128, 237, .28), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-primary:hover { background: linear-gradient(180deg, #2f80ed, #1769d2); color: #fff; box-shadow: 0 7px 18px rgba(47,128,237,.36); }
.btn-secondary { background: #fff; border-color: var(--border-strong); color: var(--text-soft); }
.btn-secondary:hover { border-color: #b9c5d8; background: #f9fbfe; color: var(--text); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #edf2f9; color: var(--text); }
.btn-danger-outline { background: #fff; border-color: #f2c5ca; color: #c94a55; }
.btn-danger-outline:hover { background: var(--danger-soft); border-color: #e9a6ae; color: #b83c48; }
.btn-success { background: linear-gradient(180deg, #28bd88, var(--success)); color: #fff; box-shadow: 0 5px 14px rgba(26,168,116,.25); }
.btn-success:hover { color: #fff; background: #159766; }
.btn-block { width: 100%; }
.btn-lg { height: 44px; padding: 0 22px; font-size: 13.5px; border-radius: 10px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 11.5px; }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center;
  border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted);
  transition: .16s;
}
.icon-btn:hover { background: #eef3fa; color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn-success:hover { background: var(--success-soft); color: var(--success); }
.link-small { font-size: 12px; font-weight: 600; }
.link-arrow { font-size: 18px; line-height: 1; color: var(--accent); }
.text-danger { color: var(--danger); }

/* ---------- Avatars ---------- */
.avatar {
  display: inline-grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #e8f0ff, #cfe0fb);
  color: #2b63ad;
  font-weight: 700; letter-spacing: -.03em;
  flex: 0 0 auto;
  width: 36px; height: 36px; font-size: 12px;
}
.avatar-xs { width: 30px; height: 30px; font-size: 10px; }
.avatar-xxs { width: 22px; height: 22px; font-size: 8.5px; }
.avatar-sm { width: 31px; height: 31px; font-size: 10.5px; }
.avatar-md { width: 42px; height: 42px; font-size: 13px; }
.avatar-xl { width: 58px; height: 58px; font-size: 19px; border-radius: 18px; }
.avatar-xl.avatar { border-radius: 18px; }

/* ---------- Cards & grids ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 19px 22px;
  border-bottom: 1px solid var(--border);
}
.card-header h2 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.card-header p { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.card-body { padding: 22px; }
.card-body.no-pad { padding: 0; }
.step-badge {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 50%; background: #f1f5fb; color: #8fa0ba;
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
}
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--muted); margin-bottom: 14px;
}
.breadcrumb a { color: var(--muted); font-weight: 500; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: #b8c2d3; }

.page-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.toolbar-stats { display: flex; align-items: baseline; gap: 8px; color: var(--muted); font-size: 12px; }
.toolbar-count { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.03em; }
.toolbar-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.toolbar-inline { display: flex; align-items: center; gap: 8px; }

/* ---------- Flash / toast ---------- */
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.flash {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 12.5px;
  animation: flash-in .2s ease;
}
@keyframes flash-in { from { opacity: 0; transform: translateY(-4px); } }
.flash-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; background: var(--accent); }
.flash-text { flex: 1; }
.flash-close { border: 0; background: transparent; color: #a3aec0; font-size: 18px; line-height: 1; padding: 0 2px; }
.flash-success { border-color: #c8ecdd; background: #f2fcf8; }
.flash-success .flash-dot { background: var(--success); }
.flash-danger { border-color: #f4cbd0; background: #fff7f8; }
.flash-danger .flash-dot { background: var(--danger); }
.flash-warning { border-color: #f5dfb8; background: #fffbf2; }
.flash-warning .flash-dot { background: var(--warning); }
.flash-info .flash-dot { background: var(--accent); }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px);
  background: var(--navy-800); color: #fff;
  padding: 11px 18px; border-radius: 10px;
  font-size: 12.5px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: .2s; z-index: 200;
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #a93d48; }

.notice {
  border-radius: 12px; padding: 14px 16px; font-size: 12.5px;
  border: 1px solid var(--border); background: #fff; margin-bottom: 16px;
}
.notice-info { background: #f4f8ff; border-color: #d6e4fb; color: #315d99; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field-label { font-size: 11.5px; font-weight: 600; color: var(--text-soft); }
.field-label em { color: var(--danger); font-style: normal; }
.field-hint { font-size: 11px; color: var(--muted); line-height: 1.4; }
.field-error { font-size: 11px; color: var(--danger); font-weight: 500; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="number"], input[type="search"], input[type="datetime-local"], select, textarea {
  width: 100%;
  min-height: 41px;
  padding: 9px 12px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  color: var(--text);
  font-size: 12.5px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { resize: vertical; min-height: 76px; line-height: 1.55; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237d8aa1' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 34px;
}
input:focus, select:focus, textarea:focus {
  border-color: #8bb7f4;
  box-shadow: 0 0 0 3px rgba(47, 128, 237, .12);
}
input:disabled, select:disabled { background: #f5f7fa; color: #7b879c; cursor: not-allowed; }
input::placeholder, textarea::placeholder { color: #a9b3c4; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid + .form-grid { margin-top: 2px; }
.input-wrap { position: relative; display: block; }
.input-wrap svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: #97a4b9; pointer-events: none;
}
.input-wrap input { padding-left: 38px; }
.input-suffix { position: relative; display: block; }
.input-suffix input { padding-right: 34px; }
.input-suffix > span {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 12px;
}
.check-card {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px;
  background: #f8fafd;
  border: 1px solid var(--border);
  border-radius: 9px;
  min-height: 43px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.check-card:hover { border-color: #c9d4e5; background: #f6f9fe; }
.check-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-visual {
  width: 19px; height: 19px; flex: 0 0 19px;
  border: 1.5px solid #b9c5d8; border-radius: 5px; background: #fff;
  display: grid; place-items: center;
  transition: .15s;
}
.check-visual::after {
  content: ""; width: 9px; height: 5px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px) scale(0);
  transition: transform .15s;
}
.check-card input:checked + .check-visual { background: var(--accent); border-color: var(--accent); }
.check-card input:checked + .check-visual::after { transform: rotate(-45deg) translateY(-1px) scale(1); }
.check-card input:focus-visible + .check-visual { box-shadow: 0 0 0 3px rgba(47,128,237,.16); }
.check-copy { display: flex; flex-direction: column; }
.check-copy strong { font-size: 11.5px; font-weight: 600; }
.check-copy small { font-size: 10.5px; color: var(--muted); }

.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.form-main { display: flex; flex-direction: column; gap: 16px; }
.form-aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 94px; }
.aside-card { padding: 20px; }
.aside-card h3 { font-size: 13.5px; font-weight: 700; margin-bottom: 9px; }
.aside-card p { font-size: 12px; color: var(--text-soft); line-height: 1.55; }
.aside-card .btn { margin-top: 12px; }
.aside-icon {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--warning-soft); color: var(--warning); margin-bottom: 12px;
}
.aside-icon svg { width: 20px; height: 20px; }
.aside-icon-blue { background: var(--accent-soft); color: var(--accent); }
.aside-card-muted { background: #f8fafc; }
.aside-list { margin: 8px 0 0; padding-left: 16px; color: var(--text-soft); font-size: 12px; line-height: 1.7; }
.aside-note {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; color: var(--muted); line-height: 1.45; margin-top: 12px;
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 3px rgba(26,168,116,.14); flex: 0 0 6px;
}
.form-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border);
}
.form-actions-card { padding: 16px 22px; margin-top: 0; background: #fbfcfe; border-radius: 0 0 var(--radius) var(--radius); }
.form-actions-inline { margin-top: 20px; }
.narrow-form { max-width: 880px; }

/* ---------- Tables ---------- */
.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: #8a97ac;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #eef2f7;
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: #fafcff; }
.data-table tbody tr.row-missed { background: #fffaf4; }
.data-table tbody tr.row-missed:hover { background: #fff4e6; }
.data-table .row-action { width: 42px; text-align: right; }
.row-actions-cell { display: flex; align-items: center; gap: 2px; justify-content: flex-end; }
.row-chevron {
  width: 30px; height: 30px; display: inline-grid; place-items: center;
  border-radius: 8px; color: #a5b0c2;
}
.row-chevron:hover { background: #eef3fb; color: var(--accent); }
.row-chevron svg { width: 16px; height: 16px; }
.row-overdue { background: #fffafa; }
.row-overdue:hover { background: #fff6f7; }
.row-inactive { opacity: .62; }
.money-cell { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.compact-table th { padding: 9px 13px; }
.compact-table td { padding: 10px 13px; }
.table-sub { display: block; font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.truncate { display: inline-block; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.client-cell { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.client-copy { display: flex; flex-direction: column; min-width: 0; }
.client-name { font-weight: 600; color: var(--text); }
.client-name:hover { color: var(--accent); }
.client-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.phone-link { color: var(--text-soft); font-weight: 500; white-space: nowrap; }
.phone-link:hover { color: var(--accent); }
.manager-cell { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.manager-cell .avatar { background: #eef3fa; color: #5e7596; }

/* ---------- Pills, chips, statuses ---------- */
.stage-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10.5px; font-weight: 600;
  white-space: nowrap;
  color: color-mix(in srgb, var(--pill-color, #2f80ed) 72%, #17233c);
  background: color-mix(in srgb, var(--pill-color, #2f80ed) 10%, #fff);
  border: 1px solid color-mix(in srgb, var(--pill-color, #2f80ed) 24%, #fff);
}
.stage-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pill-color, #2f80ed); flex: 0 0 6px; }
.stage-badge-fail { color: #b3454f; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 6px;
  font-size: 10px; font-weight: 600; white-space: nowrap;
  background: #eef2f8; color: #5e6d85;
}
.chip-soft { background: #f0f4fa; color: #63738c; font-weight: 500; }
.chip-muted { background: #f4f6f9; color: #93a0b3; font-weight: 500; }
.chip-warning { background: var(--warning-soft); color: #b27418; }
.chip-warning-soft { background: #fff7ea; color: #b47b28; font-weight: 500; }
.missed-badge {
  display: inline-flex; align-items: center; gap: 4px; align-self: flex-start;
  padding: 2px 7px; border-radius: 999px;
  font-size: 9.5px; font-weight: 700; color: #b03a2e;
  background: #fdecea; border: 1px solid #f6c9c4;
  white-space: nowrap;
}
.missed-badge::before { content: "⚠"; font-size: 10px; }
.chip-success { background: var(--success-soft); color: #14845b; }
.chip-success-soft { background: var(--success-soft); color: #14845b; font-weight: 500; }
.role-badge {
  display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 6px;
  font-size: 10px; font-weight: 600; white-space: nowrap;
}
.role-admin { background: #efeafe; color: #6247d6; }
.role-manager { background: #eaf2ff; color: #2b6fc9; }
.status-badge {
  display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 6px;
  font-size: 10px; font-weight: 600; white-space: nowrap;
}
.status-open { background: var(--accent-soft); color: #2267c4; }
.status-done { background: var(--success-soft); color: #14845b; }
.status-cancelled { background: #f1f3f7; color: #8a97aa; }
.status-ok { color: var(--success); font-weight: 600; }
.status-warn { color: var(--warning); font-weight: 600; }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600;
  background: #f3f5f9; color: #7e8ba0;
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-online { background: var(--success-soft); color: #14845b; }
.status-offline { background: #f6f0ee; color: #b07a67; }
.priority { font-size: 10px; font-weight: 600; padding: 3px 7px; border-radius: 5px; }
.priority-low { background: #f2f5f9; color: #7c8da5; }
.priority-normal { background: #eaf2ff; color: #2b6fc9; }
.priority-high { background: var(--danger-soft); color: #c34a55; }
.overdue-chip { font-size: 10.5px; font-weight: 600; color: var(--danger); background: var(--danger-soft); padding: 4px 9px; border-radius: 6px; }
.access-chips { display: flex; gap: 4px; flex-wrap: wrap; }

/* ---------- Filters ---------- */
.filter-card { padding: 13px 16px; margin-bottom: 16px; }
.filters { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.filters-right { margin-left: auto; }
.search-field { position: relative; flex: 1 1 260px; max-width: 420px; }
.search-field svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: #9aa7bb; pointer-events: none;
}
.search-field input { padding-left: 36px; background: #f8fafd; border-color: var(--border); }
.select-field select { min-width: 150px; height: 38px; min-height: 38px; padding-top: 6px; padding-bottom: 6px; background-color: #fff; }
.filters .btn { height: 38px; }

/* ---------- Pagination ---------- */
.pagination {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 18px; border-top: 1px solid var(--border);
}
.pagination-info { font-size: 11px; color: var(--muted); }
.pagination-links { display: flex; gap: 3px; }
.page-btn {
  min-width: 29px; height: 29px; padding: 0 7px;
  display: inline-grid; place-items: center;
  border-radius: 7px; font-size: 11.5px; font-weight: 500; color: var(--text-soft);
}
.page-btn:hover { background: #f1f5fa; }
.page-btn.active { background: var(--accent); color: #fff; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 54px 24px 30px; }
.empty-icon {
  width: 52px; height: 52px; margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: 16px; background: #f1f5fb; color: #9cabc0;
  font-size: 22px;
}
.empty-state h3 { font-size: 15px; font-weight: 700; margin-bottom: 5px; }
.empty-state p { font-size: 12px; color: var(--muted); max-width: 420px; margin: 0 auto; }
.empty-action { text-align: center; padding-bottom: 36px; }

/* ---------- Kanban ---------- */
.kanban-stats {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px; margin-bottom: 14px;
}
.kanban-stat {
  background: #fff; border: 1px solid var(--border); border-radius: 11px;
  padding: 12px 15px; box-shadow: var(--shadow);
}
.kanban-stat-label { display: block; font-size: 9.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.kanban-stat strong { font-size: 18px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kanban-stat-wide strong { font-size: 15px; }
.kanban-filters { padding: 11px 14px; }
.kanban-scroll { overflow-x: auto; margin: 0 -6px; padding: 0 6px 16px; }
.kanban-board { display: flex; align-items: flex-start; gap: 12px; min-width: max-content; }
.kanban-column {
  width: 286px; flex: 0 0 286px;
  background: #e9eef6;
  border: 1px solid #dfe6f0;
  border-radius: 13px;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 300px);
  min-height: 300px;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.kanban-column.drag-over { background: #e0eaf9; border-color: #a8c8f5; box-shadow: 0 0 0 3px rgba(47,128,237,.1); }
.kanban-column-head {
  padding: 12px 13px 10px;
  border-bottom: 1px solid #dce3ee;
  position: relative;
}
.kanban-column-head::before {
  content: ""; position: absolute; left: 13px; right: 13px; top: 0;
  height: 2.5px; border-radius: 0 0 3px 3px;
  background: var(--stage-color, var(--accent)); opacity: .85;
}
.kanban-col-title { display: flex; align-items: center; gap: 7px; }
.kanban-col-title h3 { font-size: 11.5px; font-weight: 700; line-height: 1.25; flex: 1; }
.kanban-col-title .stage-dot { width: 7px; height: 7px; flex: 0 0 7px; }
.kanban-count {
  min-width: 20px; height: 19px; padding: 0 6px;
  display: inline-grid; place-items: center;
  background: rgba(255,255,255,.75); border-radius: 20px;
  font-size: 9.5px; font-weight: 700; color: #5f708a;
}
.kanban-col-sum { margin-top: 5px; padding-left: 14px; font-size: 9.5px; color: #8b98ab; font-weight: 500; }
.kanban-column-body {
  padding: 9px; overflow-y: auto; flex: 1;
  display: flex; flex-direction: column; gap: 8px;
  scrollbar-width: thin;
}
.kanban-column-body::-webkit-scrollbar { width: 5px; }
.kanban-column-body::-webkit-scrollbar-thumb { background: #c6d1e1; border-radius: 5px; }
.kanban-card {
  background: #fff; border: 1px solid #e2e8f1; border-radius: 10px;
  padding: 11px 12px 10px;
  box-shadow: 0 1px 2px rgba(20, 37, 70, .04);
  cursor: grab;
  transition: box-shadow .15s, transform .15s, border-color .15s;
  border-left: 2.5px solid transparent;
}
.kanban-card:hover { box-shadow: 0 7px 18px rgba(20, 37, 70, .1); transform: translateY(-1px); border-color: #d7e1ef; }
.kanban-card:active { cursor: grabbing; }
.kanban-card.is-failed { border-left-color: #e2a2a7; }
.kanban-card.is-missed { border-left-color: #e07a3f; background: #fffaf4; }
.kanban-card.dragging { opacity: .45; transform: rotate(1.2deg); }
.kanban-card-missed {
  display: flex; align-items: center; gap: 4px;
  margin-top: 6px; padding: 4px 7px; border-radius: 6px;
  background: #fdecea; border: 1px solid #f6c9c4;
  color: #b03a2e; font-size: 9.5px; font-weight: 600;
}
.kanban-card-missed span { font-size: 11px; }
.kanban-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.kanban-card-name { font-size: 12.5px; font-weight: 650; color: var(--text); line-height: 1.3; }
.kanban-card-name:hover { color: var(--accent); }
.card-flag { font-size: 8.5px; font-weight: 700; text-transform: uppercase; color: #b27418; background: var(--warning-soft); padding: 2px 5px; border-radius: 4px; }
.kanban-card-phone { display: block; font-size: 10.5px; color: #72829a; margin-top: 1px; }
.kanban-card-phone:hover { color: var(--accent); }
.kanban-card-car {
  display: flex; align-items: center; gap: 5px;
  margin-top: 7px; padding: 5px 7px;
  background: #f6f9fd; border-radius: 6px;
  color: #53657e; font-size: 10px;
}
.kanban-card-car svg { width: 12px; height: 12px; flex: 0 0 12px; color: #8a9bb3; }
.kanban-card-car span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kanban-card-budget { margin-top: 6px; font-size: 12px; font-weight: 700; letter-spacing: -.02em; }
.kanban-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.kanban-tags .chip { font-size: 8.5px; padding: 2px 6px; }
.kanban-card-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  margin-top: 9px; padding-top: 8px; border-top: 1px solid #eef2f7;
}
.kanban-manager { display: flex; align-items: center; gap: 5px; font-size: 9.5px; color: #73839b; overflow: hidden; white-space: nowrap; }
.kanban-manager.unassigned { color: #b48a4a; }
.kanban-date { font-size: 9px; color: #a6b1c2; }
.kanban-empty {
  border: 1px dashed #cdd8e7; border-radius: 9px;
  padding: 22px 10px; text-align: center;
  font-size: 10.5px; color: #9aa8bc;
}

/* ---------- Modal ---------- */
.modal {
  border: 0; padding: 0; background: transparent;
  max-width: min(440px, 92vw); width: 100%;
}
.modal::backdrop { background: rgba(13, 24, 46, .45); backdrop-filter: blur(2px); }
.modal-card {
  background: #fff; border-radius: 15px; padding: 22px;
  box-shadow: var(--shadow-lg);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.modal-head h3 { font-size: 16px; font-weight: 700; }
.eyebrow { display: block; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 3px; }
.modal-text { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* ---------- Lead detail ---------- */
.lead-hero {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
  padding: 22px; margin-bottom: 16px;
}
.lead-hero-main { display: flex; gap: 15px; min-width: 0; }
.lead-hero-copy { min-width: 0; }
.lead-hero-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lead-hero-title h2 { font-size: 21px; font-weight: 750; letter-spacing: -.03em; }
.lead-hero-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 4px; font-size: 12px; color: var(--text-soft); }
.dot-sep { color: #c0c9d8; }
.lead-hero-car {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px; padding: 5px 9px;
  background: #f5f8fd; border: 1px solid #e7edf6; border-radius: 7px;
  font-size: 11px; color: #53657e;
}
.lead-hero-car svg { width: 14px; height: 14px; color: #8597af; }
.lead-hero-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.missed-call-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 18px; margin-bottom: 16px;
  background: #fff7ee; border-color: #f2d3ad;
}
.missed-call-banner-main { display: flex; align-items: flex-start; gap: 11px; min-width: 0; }
.missed-call-icon {
  display: inline-grid; place-items: center; width: 28px; height: 28px;
  flex: 0 0 28px; border-radius: 50%;
  background: #fdecea; color: #b03a2e; font-size: 15px;
}
.missed-call-banner strong { display: block; font-size: 12.5px; color: #8f3b2c; }
.missed-call-banner-main > div > span { display: block; font-size: 11px; color: #8a6a4a; margin-top: 2px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.detail-main { display: flex; flex-direction: column; gap: 16px; }
.detail-aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 94px; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.info-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.info-grid > div { background: #f8fafd; border-radius: 8px; padding: 9px 11px; min-width: 0; }
.info-grid dt { font-size: 9px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #8d9bb0; margin-bottom: 2px; }
.info-grid dd { font-size: 12px; color: var(--text-soft); font-weight: 500; overflow-wrap: anywhere; }
.info-grid dd a { color: var(--text-soft); }
.info-grid dd a:hover { color: var(--accent); }
.comment-block { white-space: pre-line; font-size: 12.5px; line-height: 1.7; color: var(--text-soft); background: #f8fafd; border-radius: 9px; padding: 14px 16px; }
.note-form { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 20px; }
.note-form textarea { flex: 1; min-height: 44px; }
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 1px; background: #e7ecf4; }
.timeline-item { position: relative; padding-bottom: 15px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute; left: -19px; top: 4px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #c3cfdf; border: 2px solid #fff; box-shadow: 0 0 0 1px #e2e8f1;
}
.timeline-stage { background: var(--accent); }
.timeline-created { background: var(--success); }
.timeline-note { background: var(--violet); }
.timeline-website { background: var(--warning); }
.timeline-merge { background: #c08b2c; }
.timeline-task { background: #3d9aa8; }
.timeline-beeline_call { background: #2b95bb; }
.timeline-missed_call { background: var(--danger); }
.timeline-missed_call_resolved { background: var(--success); }
.timeline-body p { font-size: 12px; color: var(--text-soft); line-height: 1.5; white-space: pre-line; }
.timeline-meta { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }
.stage-current { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 13px; font-size: 10px; }
.stage-form .field { margin-bottom: 11px; }
.manager-card { display: flex; align-items: center; gap: 10px; padding: 10px; background: #f8fafd; border-radius: 9px; }
.manager-card strong { display: block; font-size: 12px; }
.manager-card small { font-size: 10px; color: var(--muted); }
.manager-empty .avatar { background: #f2f4f8; color: #a1adbf; }
.aside-warning { border-color: #f2dcc0; background: #fffdf8; }
.duplicate-mini { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid #f4e8d7; }
.duplicate-mini:first-of-type { border-top: 0; }
.duplicate-mini strong { display: block; font-size: 11.5px; }
.duplicate-mini small { font-size: 10px; color: var(--muted); }
.aside-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.aside-card-head h3 { margin-bottom: 0; }
.task-mini { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; border-top: 1px solid #eef2f7; color: var(--text); }
.task-mini:first-of-type { border-top: 0; }
.task-mini:hover { color: var(--accent); }
.task-check { width: 14px; height: 14px; border: 1.5px solid #c3cedd; border-radius: 4px; flex: 0 0 14px; margin-top: 1px; }
.task-check.checked { background: var(--success); border-color: var(--success); position: relative; }
.task-check.checked::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 7px; border-right: 1.5px solid #fff; border-bottom: 1.5px solid #fff; transform: rotate(45deg); }
.task-mini-copy { min-width: 0; }
.task-mini-copy strong { display: block; font-size: 11.5px; font-weight: 500; line-height: 1.35; }
.task-mini-copy small { font-size: 9.5px; color: var(--muted); }
.task-done .task-mini-copy strong { text-decoration: line-through; color: #9aa7ba; }
.meta-list { display: flex; flex-direction: column; gap: 7px; }
.meta-list > div { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; }
.meta-list dt { color: var(--muted); }
.meta-list dd { color: var(--text-soft); text-align: right; }
.meta-label { display: block; font-size: 9px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* ---------- Duplicates page ---------- */
.duplicate-layout { max-width: 900px; display: flex; flex-direction: column; gap: 16px; }
.duplicate-hero {
  display: flex; gap: 16px; padding: 22px;
  background: linear-gradient(120deg, #fffaf1, #fff);
  border: 1px solid #f3ddbd; border-radius: var(--radius);
}
.duplicate-icon { width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; background: var(--warning-soft); color: var(--warning); border-radius: 13px; }
.duplicate-icon svg { width: 24px; height: 24px; }
.duplicate-hero h2 { font-size: 17px; font-weight: 700; margin: 2px 0 5px; letter-spacing: -.02em; }
.duplicate-hero p { font-size: 12px; color: var(--text-soft); line-height: 1.55; }
.duplicate-grid { display: flex; flex-direction: column; gap: 10px; }
.duplicate-card { background: #fff; border: 1px solid var(--border); border-radius: 11px; padding: 16px; box-shadow: var(--shadow); }
.duplicate-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.duplicate-card-head h3 { font-size: 14px; font-weight: 700; }
.duplicate-card-head .muted { font-size: 10px; }
.duplicate-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0; font-size: 11px; color: var(--muted); }
.duplicate-meta b { color: var(--text-soft); font-weight: 600; }
.duplicate-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.duplicate-card-actions form { display: inline-flex; }
.duplicate-summary .info-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.comment-preview { margin-top: 12px; font-size: 12px; color: var(--text-soft); white-space: pre-line; background: #f8fafd; border-radius: 8px; padding: 10px 12px; }
.duplicate-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Stats ---------- */
.segmented { display: inline-flex; background: #e9eef6; border-radius: 9px; padding: 3px; gap: 2px; }
.segmented-item { padding: 6px 12px; border-radius: 7px; font-size: 11.5px; font-weight: 500; color: #66758d; }
.segmented-item:hover { color: var(--text); }
.segmented-item.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(20,37,70,.1); font-weight: 600; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi-card { display: flex; align-items: flex-start; gap: 12px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px 17px; box-shadow: var(--shadow); }
.kpi-icon { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; display: grid; place-items: center; }
.kpi-icon svg { width: 18px; height: 18px; }
.kpi-blue { background: var(--accent-soft); color: var(--accent); }
.kpi-amber { background: var(--warning-soft); color: var(--warning); }
.kpi-green { background: var(--success-soft); color: var(--success); }
.kpi-violet { background: #f0ecff; color: var(--violet); }
.kpi-copy { display: flex; flex-direction: column; min-width: 0; }
.kpi-label { font-size: 9.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.kpi-copy strong { font-size: 22px; font-weight: 800; letter-spacing: -.035em; line-height: 1.2; margin: 1px 0; font-variant-numeric: tabular-nums; }
.kpi-copy .kpi-money { font-size: 17px; }
.kpi-copy small { font-size: 10px; color: var(--muted); }
.stats-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.stats-grid > .card:nth-child(3), .stats-grid > .card:nth-child(4) { grid-column: span 1; }
.funnel-list { display: flex; flex-direction: column; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 178px minmax(70px, 1fr) 58px 96px; align-items: center; gap: 10px; }
.funnel-label { display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: var(--text-soft); min-width: 0; }
.funnel-label span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.funnel-track { height: 7px; background: #f0f3f8; border-radius: 10px; overflow: hidden; }
.funnel-bar { height: 100%; border-radius: 10px; min-width: 2px; opacity: .82; }
.funnel-value { display: flex; align-items: baseline; gap: 4px; justify-content: flex-end; }
.funnel-value b { font-size: 11px; }
.funnel-value span { font-size: 9px; color: var(--muted); }
.funnel-budget { font-size: 9.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.dynamics-chart { display: flex; align-items: flex-end; gap: 4px; height: 190px; padding-top: 14px; }
.dynamics-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; min-width: 0; }
.dynamics-count { font-size: 8px; color: #93a1b5; height: 10px; }
.dynamics-bar { width: 100%; max-width: 18px; background: linear-gradient(180deg, #6fa8f5, var(--accent)); border-radius: 3px 3px 1px 1px; opacity: .85; min-height: 3px; }
.dynamics-col:hover .dynamics-bar { opacity: 1; }
.dynamics-label { font-size: 7.5px; color: #99a6b8; white-space: nowrap; transform: rotate(-45deg); margin-top: 2px; }
.source-list { display: flex; flex-direction: column; gap: 10px; }
.source-row { display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: 3px 8px; align-items: center; }
.source-label { display: flex; justify-content: space-between; gap: 8px; font-size: 10.5px; color: var(--text-soft); }
.source-label b { font-size: 10.5px; }
.source-track { height: 5px; background: #f0f3f8; border-radius: 8px; overflow: hidden; }
.source-bar { height: 100%; background: linear-gradient(90deg, #7db0f2, var(--accent)); border-radius: 8px; }
.source-percent { font-size: 9.5px; color: var(--muted); text-align: right; }
.consent-strip { display: flex; align-items: center; gap: 18px; padding: 16px 20px; }
.consent-strip > div:first-child { min-width: 210px; display: flex; flex-direction: column; }
.consent-strip strong { font-size: 14px; }
.consent-track { flex: 1; height: 7px; background: #eef2f8; border-radius: 8px; overflow: hidden; }
.consent-bar { height: 100%; background: linear-gradient(90deg, #57c79d, var(--success)); border-radius: 8px; }

/* ---------- Tasks ---------- */
.task-tabs { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.task-tab { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 7px; font-size: 11.5px; font-weight: 500; color: #6c7b92; }
.task-tab:hover { background: #e9eff7; color: var(--text); }
.task-tab.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(20,37,70,.1); font-weight: 600; }
.tab-count { min-width: 17px; height: 16px; padding: 0 4px; display: grid; place-items: center; background: #eef2f8; border-radius: 20px; font-size: 8.5px; color: #6f7e95; }
.task-title-link { font-weight: 600; color: var(--text); }
.task-title-link:hover { color: var(--accent); }
.task-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 16px; align-items: start; }
.task-detail-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.task-detail-title-row h2 { font-size: 17px; }
.task-description { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 16px; }
.task-description h3 { font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.task-description p { font-size: 12.5px; color: var(--text-soft); white-space: pre-line; line-height: 1.65; }
.status-connected { display: flex; align-items: center; gap: 9px; padding: 10px; background: var(--success-soft); border-radius: 9px; margin-bottom: 10px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(26,168,116,.15); }
.status-connected strong { display: block; font-size: 11.5px; }
.status-connected small { font-size: 10px; color: var(--muted); }

/* ---------- Integrations ---------- */
.integration-nav { display: flex; gap: 6px; margin-bottom: 14px; }
.integration-nav a { padding: 6px 11px; background: #fff; border: 1px solid var(--border); border-radius: 7px; font-size: 11.5px; font-weight: 500; color: var(--text-soft); }
.integration-nav a:hover { border-color: #b9c9e2; color: var(--accent); }
.integration-card { margin-bottom: 16px; scroll-margin-top: 90px; }
.integration-title { display: flex; align-items: center; gap: 12px; }
.integration-icon { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.integration-icon svg { width: 20px; height: 20px; }
.integration-icon-amber { background: var(--warning-soft); color: var(--warning); }
.integration-icon-sky { background: #e7f5fb; color: #2b95bb; }
.integration-icon-green { background: var(--success-soft); color: var(--success); }
.integration-icon-violet { background: #f0ecff; color: var(--violet); }
.webhook-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 10px; margin-bottom: 14px; }
.copy-box { background: #f8fafd; border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; min-width: 0; }
.copy-label { display: block; font-size: 9px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.copy-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.copy-row code { flex: 1; font-size: 10.5px; color: #37506f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.copy-row .icon-btn { width: 28px; height: 28px; flex: 0 0 28px; }
.copy-row .icon-btn svg { width: 14px; height: 14px; }
.copy-row form { flex: 0 0 auto; }
.webhook-example { background: #101b34; border-radius: 10px; overflow: hidden; }
.example-head { display: flex; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.07); color: #cdd9ee; font-size: 10.5px; }
.example-head span { color: #6f86ad; font-family: ui-monospace, monospace; }
.code-block { margin: 0; padding: 14px; overflow-x: auto; color: #a9c4ec; font-size: 10.5px; line-height: 1.6; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.webhook-example .muted { padding: 0 14px 12px; color: #7d90ae; font-size: 10.5px; }
.webhook-example code { color: #c4d6f1; }
.subsection { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.subsection-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.subsection-head h3 { font-size: 12.5px; font-weight: 700; }
.notification-scope { margin-top: 4px; }
.scope-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.scope-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.scope-card { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; cursor: pointer; background: #fafcff; height: 100%; }
.scope-card b { font-size: 11.5px; font-weight: 600; }
.scope-card small { font-size: 10px; color: var(--muted); line-height: 1.4; }
.scope-option input:checked + .scope-card { border-color: var(--accent); background: #f5f9ff; box-shadow: 0 0 0 1px rgba(47,128,237,.25); }
.scope-option input:focus-visible + .scope-card { box-shadow: 0 0 0 3px rgba(47,128,237,.14); }
.recipient-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 10px; }
.recipient-option { display: flex; align-items: center; gap: 7px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; background: #fff; }
.recipient-option input { width: 14px; height: 14px; accent-color: var(--accent); }
.recipient-copy { display: flex; flex-direction: column; min-width: 0; }
.recipient-copy strong { font-size: 10.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recipient-copy small { font-size: 9px; color: var(--muted); }
.recipient-grid.disabled { opacity: .45; pointer-events: none; }
.telegram-status { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-bottom: 16px; }
.telegram-status-item { background: #f8fafd; border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; }
.telegram-status-item strong { display: block; font-size: 12px; margin: 2px 0; }
.telegram-status-item small { font-size: 9.5px; color: var(--muted); }
.telegram-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.subcard { border: 1px solid var(--border); border-radius: 10px; padding: 16px; background: #fbfcfe; }
.subcard h3 { font-size: 12.5px; font-weight: 700; margin-bottom: 10px; }
.subcard .muted { font-size: 11px; margin-bottom: 10px; }
.subcard .link-small { display: inline-block; margin-top: 10px; }
.inline-form { display: inline-block; margin-top: 8px; }
.inline-code { font-family: ui-monospace, monospace; font-size: 10.5px; background: #f2f5fa; padding: 2px 5px; border-radius: 4px; color: #51647f; }
.link-code-box { background: #f4f8ff; border: 1px dashed #c4d9f7; border-radius: 9px; padding: 11px 13px; margin: 10px 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.link-code-box code { font-family: ui-monospace, monospace; font-size: 15px; font-weight: 700; letter-spacing: .08em; color: #2a68b8; }
.instruction { display: grid; grid-template-columns: 20px 1fr; gap: 5px 8px; align-items: center; font-size: 11px; color: var(--text-soft); margin: 12px 0; }
.instruction span { width: 20px; height: 20px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border-radius: 50%; font-size: 9px; font-weight: 700; }

/* ---------- Backups ---------- */
.backup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.export-stat { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.export-stat strong { font-size: 30px; font-weight: 800; letter-spacing: -.04em; }
.export-stat span { font-size: 11.5px; color: var(--muted); }
.export-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.export-actions .muted { font-size: 10.5px; }
.export-note { margin-top: 16px; background: #f8fafd; border-radius: 9px; padding: 11px 13px; font-size: 10.5px; color: var(--muted); line-height: 1.55; }
.export-note b { color: var(--text-soft); }
.backup-list { display: flex; flex-direction: column; max-height: 330px; overflow-y: auto; }
.backup-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid #eef2f7; }
.backup-row:first-child { border-top: 0; }
.backup-icon { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; background: #f1f5fb; border-radius: 7px; color: #7890ae; }
.backup-icon svg { width: 15px; height: 15px; }
.backup-copy { flex: 1; min-width: 0; }
.backup-copy strong { display: block; font-size: 10.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backup-copy small { font-size: 9.5px; color: var(--muted); }
.backup-row .icon-btn { width: 28px; height: 28px; }
.backup-row .icon-btn svg { width: 14px; height: 14px; }
.security-note { display: flex; gap: 14px; padding: 18px 20px; background: #f8fafc; }
.security-note-icon { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; background: #eaf2ff; color: var(--accent); border-radius: 10px; }
.security-note-icon svg { width: 18px; height: 18px; }
.security-note h3 { font-size: 12.5px; font-weight: 700; margin-bottom: 3px; }
.security-note p { font-size: 11px; color: var(--muted); }

/* ---------- Admin ---------- */
.admin-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 10px; margin-bottom: 16px; }
.admin-stat { background: #fff; border: 1px solid var(--border); border-radius: 11px; padding: 12px 16px; box-shadow: var(--shadow); }
.admin-stat strong { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.admin-stat-action { display: flex; align-items: center; justify-content: flex-end; background: transparent; border: 0; box-shadow: none; }
.access-help { margin-top: 16px; padding: 18px 20px; }
.access-help h3 { font-size: 12.5px; font-weight: 700; margin-bottom: 10px; }
.access-help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.access-help-grid p { font-size: 11px; color: var(--muted); margin-top: 5px; line-height: 1.55; }
.admin-form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 16px; align-items: start; }
.admin-form-aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 94px; }
.users-table td { vertical-align: middle; }

/* ---------- Profile ---------- */
.profile-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px; margin-bottom: 16px; }
.profile-hero-main { display: flex; align-items: center; gap: 16px; }
.profile-name-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.profile-name-row h2 { font-size: 20px; font-weight: 750; letter-spacing: -.03em; }
.profile-stats { display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: 10.5px; color: var(--muted); margin-top: 7px; }
.profile-stats b { color: var(--text); font-weight: 700; }
.profile-hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }

/* ---------- Notifications ---------- */
.notifications-card { overflow: hidden; }
.notification-list { display: flex; flex-direction: column; }
.notification-item { display: flex; align-items: flex-start; gap: 12px; padding: 15px 18px; border-bottom: 1px solid #eef2f7; color: var(--text); }
.notification-item:last-child { border-bottom: 0; }
.notification-item:hover { background: #fafcff; color: var(--text); }
.notification-item.unread { background: #f7fbff; }
.notification-item.unread:hover { background: #f1f8ff; }
.notification-icon { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 9px; background: #f1f5fb; color: #71849e; font-weight: 700; font-size: 13px; }
.notification-website { background: var(--warning-soft); color: var(--warning); }
.notification-warning { background: var(--danger-soft); color: var(--danger); }
.notification-task { background: var(--success-soft); color: var(--success); }
.notification-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notification-title { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.unread-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.notification-body { font-size: 11px; color: var(--text-soft); }
.notification-meta { font-size: 9.5px; color: var(--muted); }

/* ---------- Login / auth ---------- */
.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(80% 80% at 100% 0%, rgba(47,128,237,.09), transparent 50%),
    #eef2f8;
}
.auth-shell { display: grid; grid-template-columns: 1.04fr 1fr; min-height: 100vh; }
.auth-visual {
  position: relative; overflow: hidden;
  padding: 44px 52px;
  color: #fff;
  display: flex; flex-direction: column;
  background:
    radial-gradient(70% 60% at 15% 20%, rgba(47,128,237,.26), transparent 60%),
    radial-gradient(50% 50% at 90% 90%, rgba(123,97,255,.16), transparent 60%),
    linear-gradient(145deg, var(--navy-900), var(--navy-950));
}
.auth-brand { display: inline-flex; align-items: center; gap: 11px; color: #fff; align-self: flex-start; position: relative; z-index: 2; }
.auth-brand:hover { color: #fff; }
.auth-visual-content { margin: auto 0; max-width: 460px; position: relative; z-index: 2; }
.auth-kicker { display: inline-block; padding: 5px 10px; border: 1px solid rgba(255,255,255,.14); border-radius: 20px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #9db7df; }
.auth-visual h1 { font-size: clamp(34px, 4.4vw, 56px); line-height: 1.03; letter-spacing: -.045em; font-weight: 800; margin: 18px 0 14px; }
.auth-visual p { max-width: 390px; color: #a9bbd7; font-size: 14px; line-height: 1.6; }
.auth-features { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 32px; }
.auth-feature { padding: 11px 14px; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.09); border-radius: 11px; font-size: 10.5px; color: #a9bbd7; }
.auth-feature span { display: block; font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 1px; }
.auth-visual-footer { position: relative; z-index: 2; font-size: 10px; color: #62789c; }
.auth-glow { position: absolute; border-radius: 50%; filter: blur(70px); pointer-events: none; }
.auth-glow-1 { width: 380px; height: 380px; background: rgba(47,128,237,.22); top: -80px; right: -80px; }
.auth-glow-2 { width: 300px; height: 300px; background: rgba(123,97,255,.14); bottom: -60px; left: 20%; }
.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 38px; }
.auth-form-card { width: 100%; max-width: 384px; }
.auth-form-card h2 { font-size: 24px; font-weight: 750; letter-spacing: -.03em; margin-bottom: 5px; }
.auth-subtitle { font-size: 12px; color: var(--muted); margin-bottom: 22px; }
.auth-mobile-brand { display: none; align-items: center; gap: 9px; margin-bottom: 26px; }
.auth-form .field { margin-bottom: 14px; }
.auth-form input { height: 44px; }
.auth-hint { font-size: 10.5px; color: var(--muted); text-align: center; margin-top: 18px; }
.btn-block + .btn-block { margin-top: 7px; }

.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.error-card { text-align: center; max-width: 440px; background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 40px 36px; box-shadow: var(--shadow-lg); }
.error-code { display: inline-block; font-size: 56px; font-weight: 800; letter-spacing: -.06em; line-height: 1; color: var(--accent); }
.error-card h1 { font-size: 19px; margin: 14px 0 7px; }
.error-card p { font-size: 12px; color: var(--muted); line-height: 1.6; }
.error-actions { display: flex; justify-content: center; gap: 8px; margin-top: 20px; }

/* ---------- Документы, договор, комментарии ---------- */
.doc-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px; margin-bottom: 14px;
}
.doc-card {
  border: 1px solid var(--border); border-radius: 11px;
  padding: 13px 14px; background: #fff;
  display: flex; flex-direction: column; gap: 8px;
}
.doc-card.doc-loaded { border-color: #bfe7d6; background: #fbfffd; }
.doc-card.doc-missing { background: #fbfcfe; }
.doc-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.doc-card-head strong { font-size: 12px; line-height: 1.35; }
.doc-meta { font-size: 11px; color: var(--text-soft); line-height: 1.5; overflow-wrap: anywhere; }
.doc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.doc-actions form { display: inline; }
.doc-upload-form { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 2px; }
.doc-upload-form input[type="file"] {
  flex: 1 1 160px; min-width: 0; font-size: 10.5px;
  border: 1px dashed #cdd8e8; border-radius: 8px; padding: 6px 8px; background: #f8fafd;
}
.doc-broker { margin-top: 2px; }
.broker-form { display: flex; flex-direction: column; gap: 9px; margin-top: 4px; }
.doc-file-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.doc-file-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 8px; background: #f7f9fc; font-size: 11px;
}
.doc-file-row form { display: inline; }
.link-danger { color: var(--danger); background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.contract-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contract-box {
  border: 1px solid var(--border); border-radius: 11px;
  padding: 14px; background: #fbfcfe; display: flex; flex-direction: column; gap: 9px;
}
.contract-box h4 { font-size: 12.5px; font-weight: 700; }
.contract-box .check-card { margin: 2px 0; }
.contract-placeholders { font-size: 10.5px; color: var(--muted); }
.contract-placeholders summary { cursor: pointer; color: var(--accent); }
.contract-placeholders p { margin-top: 5px; overflow-wrap: anywhere; }
.stage-extra { margin: 10px 0; padding-top: 10px; border-top: 1px dashed #e2e9f4; }
.stage-extra .field:last-child { margin-bottom: 4px; }
.stage-conditional { margin: 4px 0 12px; }
.comment-form { margin-bottom: 18px; }
.comment-form-actions { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.comment-form-actions .file-field { flex: 1; margin-bottom: 0; }
.comment-feed { display: flex; flex-direction: column; gap: 14px; }
.comment-item { display: flex; gap: 10px; }
.comment-body {
  flex: 1; min-width: 0; background: #f8fafd;
  border: 1px solid #eef2f8; border-radius: 10px; padding: 10px 12px;
}
.comment-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.comment-head strong { font-size: 11.5px; }
.comment-head span { font-size: 9.5px; }
.comment-body p { font-size: 12px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.comment-photos { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.comment-photos img {
  width: 94px; height: 74px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--border); display: block;
}
.doc-file-chip {
  display: inline-flex; align-items: center; padding: 8px 10px;
  border-radius: 8px; background: #eef4ff; color: var(--accent); font-size: 10.5px;
}
.task-mini-status {
  display: inline-block; margin-top: 3px; font-size: 9px; font-weight: 600;
  letter-spacing: .02em; color: var(--muted);
}
.task-mini-status.status-open { color: #2267c4; }
.task-mini-status.status-done { color: #14845b; }
.task-mini-status.status-cancelled { color: #8a97aa; }
.task-mini.task-overdue { background: #fff7f8; border-radius: 7px; padding-left: 6px; padding-right: 6px; }
.task-mini.task-overdue .task-mini-status { color: var(--danger); }

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

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .content { padding: 20px 22px 48px; }
  .topbar { padding: 0 22px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-layout { grid-template-columns: minmax(0, 1fr) 272px; }
  .detail-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .recipient-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 9px; background: #fff; color: var(--text-soft); }
  .mobile-menu svg { width: 18px; height: 18px; }
  .stats-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .backup-grid { grid-template-columns: 1fr; }
  .admin-form-layout { grid-template-columns: 1fr; }
  .admin-form-aside { position: static; }
  .task-detail-layout { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-form-side { min-height: 100vh; }
  .auth-mobile-brand { display: flex; }
}
@media (max-width: 900px) {
  .form-layout { grid-template-columns: 1fr; }
  .form-aside { position: static; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-aside { position: static; }
  .kanban-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kanban-stat-wide { grid-column: span 2; }
  .telegram-grid { grid-template-columns: 1fr; }
  .webhook-grid { grid-template-columns: 1fr; }
  .info-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-stat-action { grid-column: 1 / -1; justify-content: flex-start; }
  .consent-strip { flex-wrap: wrap; }
  .consent-track { min-width: 180px; }
}
@media (max-width: 720px) {
  .content { padding: 16px 14px 42px; }
  .topbar { height: 62px; flex-basis: 62px; padding: 0 14px; }
  .topbar h1 { font-size: 16px; }
  .topbar p { display: none; }
  .topbar-user-name { display: none; }
  .btn-new-lead { width: 38px; padding: 0; }
  .btn-new-lead span,
  .btn-new-lead { font-size: 0; }
  .btn-new-lead svg { width: 16px; height: 16px; }
  .page-toolbar { align-items: flex-start; flex-direction: column; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .kpi-card { padding: 12px; }
  .kpi-copy strong { font-size: 18px; }
  .form-grid, .form-grid-3, .form-grid-2 { grid-template-columns: 1fr; }
  .kanban-stats { grid-template-columns: 1fr 1fr; }
  .kanban-stat-wide { grid-column: span 2; }
  .kanban-column { width: 268px; flex-basis: 268px; max-height: calc(100vh - 330px); }
  .kanban-scroll { margin: 0 -14px; padding: 0 14px 12px; }
  .funnel-row { grid-template-columns: 128px minmax(50px, 1fr) 48px; }
  .funnel-budget { display: none; }
  .scope-options { grid-template-columns: 1fr; }
  .recipient-grid { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .lead-hero { flex-direction: column; }
  .lead-hero-actions { width: 100%; }
  .info-grid, .info-grid-3 { grid-template-columns: 1fr; }
  .duplicate-summary .info-grid { grid-template-columns: 1fr; }
  .profile-hero { flex-direction: column; align-items: flex-start; }
  .profile-hero-side { align-items: flex-start; }
  .notification-item { padding: 13px 14px; }
  .auth-form-side { padding: 24px; }
  .segmented { flex-wrap: wrap; }
  .duplicate-hero { flex-direction: column; }
  .modal-card { padding: 18px; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .filters { flex-direction: column; align-items: stretch; }
  .search-field { max-width: none; }
  .filters .btn { width: 100%; }
  .select-field select { width: 100%; }
  .toolbar-actions { width: 100%; }
  .topbar-actions { gap: 6px; }
  .lead-hero-title h2 { font-size: 18px; }
  .notification-icon { display: none; }
}
