@import url('https://fonts.bunny.net/css?family=manrope:400,500,600,700,800&display=swap');

:root {
  --font-ui: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-data: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --bg: #f3f5fa;
  --panel: #ffffff;
  --panel-soft: #f8f9fc;
  --text: #111827;
  --text-2: #273147;
  --muted: #7b859b;
  --line: #e3e7ef;
  --line-strong: #d8deea;
  --nav: #0c1322;
  --nav-2: #101b2f;
  --nav-3: #17243b;
  --accent: #6573ff;
  --accent-2: #7659f4;
  --accent-soft: #eef0ff;
  --good: #17996a;
  --warn: #e48449;
  --danger: #d95864;
  --shadow-sm: 0 8px 24px rgba(17, 24, 39, .045);
  --shadow-md: 0 18px 50px rgba(17, 24, 39, .08);
  --radius: 20px;
  --sidebar: 248px;
  --topbar: 72px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
html, body { margin: 0; min-height: 100%; }
body {
  min-width: 320px;
  overflow-x: hidden;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  font-synthesis: none;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

/* Premium local typography — no external font requests. */
.brand strong,
.page-head h1,
.panel-head h2,
.migration-copy h2,
.settings-grid h2,
.entity-hero h2,
.login-copy h1,
.modal-card h2,
.drawer-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-kerning: normal;
  font-feature-settings: "kern" 1, "liga" 1;
}

.stat-card strong,
.lead-amount,
.entity-hero strong,
.analytics-value,
.metric-value {
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

button, input, select, textarea, table {
  font-family: var(--font-ui);
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .62; }
input, textarea, select { min-width: 0; }
img, svg { max-width: 100%; }

.muted { color: var(--muted); }
.eyebrow,
.kicker {
  display: inline-block;
  color: #7f899e;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.eyebrow { color: #6271ef; }

.btn {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 24px rgba(101, 115, 255, .22);
}
.btn-primary:hover { filter: brightness(1.03); box-shadow: 0 13px 30px rgba(101, 115, 255, .28); }
.btn-ghost { color: #33405a; background: #edf0f6; }
.btn-ghost:hover { background: #e7eaf2; }
.btn-lg { min-height: 48px; padding: 13px 18px; font-size: 13px; }
.icon-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: #4e586c;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand > div { min-width: 0; }
.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, #6473ff, #805df8);
  box-shadow: 0 10px 24px rgba(101, 115, 255, .28);
}
.brand strong,
.brand small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand strong { color: #fff; font-size: 15px; line-height: 1.15; font-weight: 700; letter-spacing: -.012em; }
.brand small { margin-top: 3px; color: #7e899f; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }

/* Application shell: fixed nav + isolated workspace. */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar);
  min-width: var(--sidebar);
  height: 100dvh;
  padding: 22px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 10%, rgba(101, 115, 255, .12), transparent 24%),
    linear-gradient(180deg, var(--nav), #0a101c 86%);
  border-right: 1px solid rgba(255,255,255,.035);
}
.sidebar .brand { padding: 2px 2px 4px; }
.nav-list { display: grid; gap: 6px; min-width: 0; }
.nav-item {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  color: #929caf;
  background: transparent;
  text-align: left;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  transition: background .18s ease, color .18s ease;
}
.nav-item > span:first-child {
  width: 22px;
  flex: 0 0 22px;
  display: grid;
  place-items: center;
  color: #8793ab;
  font-size: 15px;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-item.active {
  color: #fff;
  background: #17243a;
  box-shadow: inset 3px 0 0 #7180ff;
}
.nav-item.active > span:first-child { color: #93a0ff; }
.sidebar-card {
  width: 100%;
  min-width: 0;
  margin-top: auto;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px;
  background: linear-gradient(145deg, #142038, #101929);
}
.sidebar-card > div:last-child { min-width: 0; }
.sidebar-card .shield {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #8794ff;
  background: #1d2d4b;
}
.sidebar-card b,
.sidebar-card span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-card b { color: #dfe5f2; font-size: 11px; }
.sidebar-card span { margin-top: 4px; color: #78849a; font-size: 9px; }
.sidebar-bottom { width: 100%; min-width: 0; display: grid; gap: 8px; }
.user-mini {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.04);
  border-radius: 14px;
  color: #fff;
  background: #111b2d;
  text-align: left;
}
.user-mini > span:last-child { min-width: 0; overflow: hidden; }
.avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #263654;
  color: #dce3ff;
  font-size: 10px;
  font-weight: 800;
}
.user-mini b,
.user-mini small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-mini b { font-size: 10px; }
.user-mini small { margin-top: 3px; color: #7e899d; font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }

.workspace {
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar);
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar);
  padding: 0 26px;
  display: grid;
  grid-template-columns: minmax(260px, 520px) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid rgba(223, 228, 238, .9);
  background: rgba(243, 245, 250, .88);
  backdrop-filter: blur(18px);
}
.search-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(20, 29, 46, .025);
}
.search-wrap > span { flex: 0 0 auto; color: #7c879a; }
.search-wrap input,
.search-inline input {
  width: 100%;
  min-width: 0;
  height: auto;
  border: 0;
  border-radius: 0;
  padding: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-size: 11px;
}
.search-wrap input::placeholder,
.search-inline input::placeholder { color: #9aa3b4; }
.search-results {
  display: none;
  position: absolute;
  top: 48px;
  left: 0;
  right: 0;
  z-index: 60;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-md);
}
.search-results.show { display: block; }
.search-result {
  min-width: 0;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: #f7f8fb; }
.search-result b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.search-result small { flex: 0 0 auto; color: var(--muted); font-size: 9px; }
.top-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}
.top-actions > * { flex: 0 0 auto; }
.top-actions .btn { max-width: 180px; }
.sync-pill {
  min-height: 36px;
  padding: 7px 11px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d9ece3;
  border-radius: 999px;
  color: #5c6c7f;
  background: #edf7f2;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}
.sync-pill i,
.dot-live {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 999px;
  background: var(--good);
  box-shadow: 0 0 0 4px rgba(23,153,106,.10);
}

.content {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 28px clamp(20px, 2.2vw, 34px) 40px;
}
.view { display: none; min-width: 0; }
.view.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-head {
  min-width: 0;
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 20px;
}
.page-head > div:first-child { min-width: 0; }
.page-head h1 {
  max-width: 800px;
  margin: 7px 0 5px;
  color: #111827;
  font-size: clamp(29px, 2.35vw, 37px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -.032em;
}
.page-head p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}
.compact-head { align-items: center; }
.head-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}
.head-actions .select { width: 220px; max-width: 34vw; }
.head-actions .btn { width: auto; max-width: 220px; }

.stats-grid {
  min-width: 0;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.stat-card {
  position: relative;
  min-width: 0;
  min-height: 132px;
  padding: 18px 56px 17px 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.stat-card > span:not(.stat-icon) {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stat-card strong {
  display: block;
  margin: 12px 0 8px;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(23px, 1.9vw, 30px);
  line-height: .98;
  font-weight: 700;
  letter-spacing: -.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stat-card small {
  display: block;
  overflow: hidden;
  color: #8e98aa;
  font-size: 9px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stat-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #6573e8;
  background: #f0f2ff;
  font-size: 12px;
  font-weight: 800;
}

.dashboard-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(300px, .92fr);
  grid-auto-flow: row;
  grid-auto-rows: min-content;
  align-items: start;
  gap: 16px;
}
.panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 10px 35px rgba(16,22,37,.035);
  padding: 20px;
}
.panel-wide { grid-row: span 2; min-height: 100%; }
.panel-head {
  min-width: 0;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.panel-head > div { min-width: 0; }
.panel-head h2,
.migration-copy h2,
.settings-grid h2 {
  margin: 5px 0 0;
  color: #172033;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.018em;
}
.link-btn {
  flex: 0 0 auto;
  border: 0;
  padding: 4px 0;
  color: #6371eb;
  background: transparent;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}
.dash-pipeline { display: grid; gap: 14px; min-width: 0; }
.dash-stage {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(86px, 116px) minmax(80px, 1fr) minmax(58px, auto);
  align-items: center;
  gap: 12px;
}
.dash-stage span { overflow: hidden; color: #68738a; font-size: 10px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 8px; overflow: hidden; border-radius: 999px; background: #edf0f5; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6372eb, #8268ef); }
.dash-stage b { color: #263147; font-size: 10px; text-align: right; white-space: nowrap; }
.task-list { min-width: 0; display: grid; gap: 9px; }
.task-item {
  min-width: 0;
  padding: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.task-item.done { opacity: .55; }
.task-check {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: grid;
  place-items: center;
  border: 1.5px solid #b9c2d2;
  border-radius: 7px;
  color: #fff;
  background: #fff;
  padding: 0;
}
.task-item.done .task-check { border-color: var(--good); background: var(--good); }
.task-main { min-width: 0; flex: 1 1 auto; }
.task-main b,
.task-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-main b { color: #202a3d; font-size: 10px; }
.task-main span { margin-top: 4px; color: var(--muted); font-size: 8px; }
.task-due { flex: 0 0 auto; color: #7f899c; font-size: 8px; white-space: nowrap; }
.activity-feed { min-width: 0; display: grid; gap: 13px; }
.activity { min-width: 0; display: flex; gap: 10px; }
.activity > div { min-width: 0; }
.activity-dot { width: 7px; height: 7px; flex: 0 0 7px; margin-top: 4px; border-radius: 999px; background: #7180ff; box-shadow: 0 0 0 4px #eef0ff; }
.activity b,
.activity span { display: block; overflow: hidden; text-overflow: ellipsis; }
.activity b { color: #202a3d; font-size: 9px; line-height: 1.35; }
.activity span { margin-top: 3px; color: var(--muted); font-size: 8px; white-space: nowrap; }

.pipeline-toolbar {
  min-width: 0;
  margin-bottom: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.pipeline-toolbar > div:first-child { min-width: 0; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.chip {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  color: #707b91;
  background: #fff;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}
.chip.active { border-color: #d8ddff; color: #5968de; background: #eef0ff; }
.sum-chip {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 7px 12px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #263149;
  background: #fff;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.select,
input,
textarea,
select {
  width: 100%;
  border: 1px solid #dce2ec;
  border-radius: 11px;
  padding: 10px 12px;
  outline: 0;
  color: #1e293d;
  background: #fff;
  font-size: 11px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
textarea { resize: vertical; }
.select:focus,
input:focus,
textarea:focus,
select:focus { border-color: #9099ff; box-shadow: 0 0 0 3px rgba(101,115,255,.10); }

.kanban {
  width: 100%;
  min-width: 0;
  min-height: calc(100vh - 205px);
  padding: 1px 2px 14px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(228px, 1fr);
  justify-content: start;
  align-items: stretch;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scrollbar-color: #cfd5e2 transparent;
}
.kanban::-webkit-scrollbar { height: 8px; }
.kanban::-webkit-scrollbar-thumb { border-radius: 999px; background: #cfd5e2; }
.stage-col {
  min-width: 0;
  min-height: 470px;
  padding: 11px;
  border: 1px solid #e0e5ed;
  border-radius: 18px;
  background: #edf0f5;
  transition: border-color .16s ease, background .16s ease;
}
.stage-col.dragover { border-color: #aeb7ff; background: #e9ecff; }
.stage-head {
  min-width: 0;
  min-height: 39px;
  padding: 3px 3px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}
.stage-title { min-width: 0; display: flex; align-items: center; gap: 8px; }
.stage-title i { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 999px; background: #7885ff; }
.stage-title b { overflow: hidden; color: #263047; font-size: 10px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.stage-head > span { flex: 0 0 auto; min-width: 28px; padding: 4px 7px; border-radius: 999px; color: #778196; background: #fff; font-size: 8px; text-align: center; }
.stage-cards { min-width: 0; }
.lead-card {
  width: 100%;
  min-width: 0;
  margin-bottom: 9px;
  padding: 13px;
  overflow: hidden;
  border: 1px solid #dfe4ec;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(20,28,45,.035);
  cursor: grab;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.lead-card:hover { transform: translateY(-2px); border-color: #d4d9e6; box-shadow: 0 12px 26px rgba(20,28,45,.08); }
.lead-card.dragging { opacity: .48; }
.lead-top { min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
.lead-card h3 { min-width: 0; margin: 0; overflow: hidden; color: #202a3d; font-size: 11px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.priority-dot { width: 7px; height: 7px; flex: 0 0 7px; margin-top: 4px; border-radius: 999px; background: #9da6b7; }
.priority-dot.high { background: #ed8650; }
.priority-dot.low { background: #49a883; }
.lead-amount { margin: 12px 0 10px; overflow: hidden; color: #172033; font-size: 14px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.lead-meta { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #7c8698; font-size: 8px; }
.lead-person { min-width: 0; display: flex; align-items: center; gap: 7px; overflow: hidden; }
.lead-person > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-avatar { width: 23px; height: 23px; flex: 0 0 23px; display: grid; place-items: center; border-radius: 8px; color: #6472e8; background: #eef0ff; font-size: 7px; font-weight: 800; }

.table-panel { padding: 0; }
.table-tools {
  min-width: 0;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}
.search-inline { width: min(300px, 100%); min-width: 0; padding: 8px 10px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 11px; background: #f7f8fb; }
.table-wrap { width: 100%; max-width: 100%; overflow: auto; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th, td { max-width: 260px; padding: 13px 18px; border-bottom: 1px solid var(--line); font-size: 10px; text-align: left; vertical-align: middle; }
th { color: #8993a6; background: #fafbfc; font-size: 8px; letter-spacing: .09em; text-transform: uppercase; }
td b, td small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.tasks-layout,
.settings-grid { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; align-items: start; }

.migration-hero {
  min-width: 0;
  margin-bottom: 16px;
  padding: 26px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(350px, .92fr);
  align-items: stretch;
  gap: clamp(22px, 3vw, 40px);
  background: radial-gradient(circle at 8% 0, #eff1ff 0, rgba(239,241,255,0) 40%), #fff;
}
.migration-copy { min-width: 0; align-self: center; }
.migration-copy h2 { max-width: 650px; font-size: 18px; }
.migration-copy p { max-width: 640px; margin: 11px 0 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.migration-features { margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px 16px; }
.migration-features span { min-width: 0; overflow: hidden; color: #4b566d; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.migration-form-card {
  width: 100%;
  min-width: 0;
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 12px;
  overflow: hidden;
  border: 1px solid #1f2c43;
  border-radius: 18px;
  color: #fff;
  background: #111a2b;
  box-shadow: 0 14px 35px rgba(10,16,28,.12);
}
.migration-form-card label,
.form-stack label,
.form-grid label { min-width: 0; display: grid; gap: 6px; color: #667187; font-size: 9px; font-weight: 750; }
.migration-form-card label { color: #aeb8ca; }
.migration-form-card input,
.migration-form-card textarea { width: 100%; max-width: 100%; border-color: #2a3953; color: #fff; background: #182439; }
.migration-form-card input::placeholder,
.migration-form-card textarea::placeholder { color: #6f7d94; }
.migration-form-card small { display: block; color: #77849b; font-size: 8px; line-height: 1.5; }
.badge-premium { align-self: end; padding: 8px 12px; border: 1px solid #d9defd; border-radius: 999px; color: #5e6de0; background: #eef0ff; font-size: 9px; font-weight: 800; white-space: nowrap; }
.migration-jobs { min-width: 0; display: grid; gap: 10px; }
.job-row {
  min-width: 0;
  padding: 12px 13px;
  display: grid;
  grid-template-columns: minmax(150px,1.15fr) minmax(100px,.65fr) minmax(150px,1fr) minmax(110px,.6fr);
  align-items: center;
  gap: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.job-row > div { min-width: 0; }
.job-row b,
.job-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-row b { color: #263147; font-size: 9px; }
.job-row small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.progress { width: 100%; height: 7px; overflow: hidden; border-radius: 999px; background: #edf0f5; }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6372eb, #7d5df0); }
.status-good { display: inline-flex; align-items: center; min-height: 26px; padding: 5px 9px; border-radius: 999px; color: var(--good); background: #edf8f3; font-size: 8px; font-weight: 800; white-space: nowrap; }
.setting-row { min-width: 0; padding: 14px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.setting-row > div { min-width: 0; }
.setting-row b,
.setting-row span { display: block; }
.setting-row b { color: #263147; font-size: 10px; }
.setting-row div span { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 8px; line-height: 1.4; }

.modal,
.drawer { display: none; position: fixed; inset: 0; z-index: 100; }
.modal.show,
.drawer.show { display: block; }
.modal-backdrop,
.drawer-backdrop { position: absolute; inset: 0; background: rgba(10,15,25,.48); backdrop-filter: blur(7px); }
.modal-card {
  position: relative;
  width: min(620px, calc(100% - 30px));
  max-height: min(88vh, 760px);
  margin: 6vh auto;
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 35px 90px rgba(9,14,25,.3);
  animation: pop .18s ease;
}
.modal-card.small { max-width: 460px; }
.modal-card h2 { margin: 7px 0 18px; }
.modal-x { position: absolute; top: 15px; right: 16px; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 10px; color: #4c5669; background: #f1f3f7; font-size: 20px; }
.form-grid { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.span-2 { grid-column: span 2; }
.modal-actions { min-width: 0; margin-top: 8px; display: flex; justify-content: flex-end; gap: 8px; }
.form-stack { min-width: 0; display: grid; gap: 13px; }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(480px, 94vw); overflow: auto; padding: 24px; background: #fff; box-shadow: -25px 0 80px rgba(9,14,25,.2); animation: slide .2s ease; }
.drawer-head h2 { margin: 7px 0; }
.drawer-meta { min-width: 0; margin: 16px 0; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.meta-card { min-width: 0; padding: 11px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #f7f8fb; }
.meta-card span,
.meta-card b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta-card span { color: var(--muted); font-size: 8px; }
.meta-card b { margin-top: 5px; color: #263147; font-size: 10px; }
.notes { min-width: 0; margin-top: 14px; display: grid; gap: 9px; }
.note { min-width: 0; padding: 10px; overflow: hidden; border-left: 2px solid #737eff; border-radius: 0 12px 12px 0; background: #f8f9fd; }
.note p { margin: 0; color: #263147; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.note small { color: var(--muted); font-size: 8px; }
.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 8px; }
.toast { max-width: min(360px, calc(100vw - 40px)); padding: 12px 14px; border-radius: 13px; color: #fff; background: #11192a; box-shadow: 0 16px 40px rgba(10,15,25,.25); font-size: 10px; animation: pop .18s ease; }
.toast.error { background: #7b2f3a; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes slide { from { transform: translateX(35px); opacity: .7; } to { transform: none; opacity: 1; } }

/* Login */
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(400px, 44%) minmax(0, 1fr); background: #0c1220; }
.login-panel { position: relative; min-width: 0; padding: 44px clamp(28px,5vw,78px); display: flex; flex-direction: column; justify-content: center; background: #fff; }
.brand-login { position: absolute; top: 30px; left: clamp(28px,5vw,78px); }
.brand-login strong { color: #121827; }
.login-copy { max-width: 470px; margin-bottom: 28px; }
.login-copy h1 { margin: 9px 0 10px; color: #111827; font-size: clamp(38px, 4vw, 50px); line-height: 1; letter-spacing: -.055em; }
.login-copy p { margin: 0; color: var(--muted); line-height: 1.7; }
.login-panel .form-stack { width: 100%; max-width: 440px; }
.form-error { min-height: 16px; color: #bf4e5b; font-size: 10px; }
.login-foot { position: absolute; bottom: 28px; display: flex; gap: 8px; color: #9aa2b1; font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.login-visual { position: relative; min-width: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 20% 20%,#202d56,transparent 35%), radial-gradient(circle at 80% 70%,#3c2768,transparent 35%), #0c1220; }
.orb { position: absolute; border-radius: 50%; filter: blur(10px); opacity: .7; }
.orb-a { top: 8%; right: 12%; width: 270px; height: 270px; background: #465df0; }
.orb-b { bottom: 10%; left: 14%; width: 220px; height: 220px; background: #8a48c7; }
.glass-card { position: absolute; max-width: calc(100% - 40px); border: 1px solid rgba(255,255,255,.13); border-radius: 22px; color: #fff; background: rgba(255,255,255,.08); backdrop-filter: blur(22px); box-shadow: 0 35px 80px rgba(0,0,0,.2); }
.metric-card { top: 16%; left: 15%; width: 190px; padding: 20px; }
.metric-card span,
.metric-card small { display: block; color: #aab4ca; font-size: 9px; }
.metric-card strong { display: block; margin: 8px 0; font-size: 38px; }
.mini-kanban { width: min(520px, 70%); padding: 20px; transform: rotate(-2deg); }
.mini-head { margin-bottom: 14px; display: flex; justify-content: space-between; }
.mini-head span { padding: 5px 7px; border-radius: 999px; color: #92a7ff; background: #26395f; font-size: 8px; }
.mini-row { min-width: 0; padding: 12px 0; display: grid; grid-template-columns: 8px minmax(0,1fr) auto; align-items: center; gap: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.mini-row i { width: 7px; height: 7px; border-radius: 999px; background: #7a86ff; }
.mini-row p { min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-row p,
.mini-row b { font-size: 10px; }
.visual-caption { position: absolute; bottom: 28px; display: flex; align-items: center; gap: 8px; color: #9aa6bd; font-size: 9px; }
.mobile-only { display: none; }

@media (max-width: 1240px) {
  :root { --sidebar: 226px; }
  .topbar { grid-template-columns: minmax(230px, 420px) minmax(0,1fr); padding-inline: 20px; }
  .top-actions .sync-pill { display: none; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: minmax(0,1.35fr) minmax(280px,.85fr); }
  .migration-hero { grid-template-columns: minmax(0,1fr) minmax(320px,.85fr); }
}

@media (max-width: 980px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .panel-wide { grid-row: auto; min-height: 0; }
  .tasks-layout,
  .settings-grid { grid-template-columns: 1fr; }
  .migration-hero { grid-template-columns: 1fr; }
  .migration-form-card { max-width: none; }
  .job-row { grid-template-columns: minmax(0,1.2fr) minmax(90px,.7fr) minmax(130px,1fr); }
  .job-row > div:last-child { grid-column: 1 / -1; }
}

@media (max-width: 780px) {
  :root { --sidebar: min(300px, 86vw); --topbar: 64px; }
  .app-shell { min-height: 100dvh; }
  .sidebar { transform: translateX(-105%); transition: transform .22s ease; box-shadow: 24px 0 70px rgba(8,13,24,.24); }
  .sidebar.open { transform: none; }
  .workspace { width: 100%; margin-left: 0; }
  .mobile-only { display: grid; }
  .topbar { height: var(--topbar); padding: 0 12px; grid-template-columns: 40px minmax(0,1fr) auto; gap: 8px; }
  .search-wrap { height: 40px; }
  .top-actions { gap: 7px; }
  .top-actions .sync-pill,
  .top-actions .icon-btn { display: none; }
  .top-actions .btn { width: 40px; height: 40px; min-height: 40px; padding: 0; font-size: 0; border-radius: 12px; }
  .top-actions .btn::after { content: "+"; font-size: 20px; line-height: 1; }
  .content { padding: 18px 13px 32px; }
  .page-head { margin-bottom: 18px; grid-template-columns: 1fr; align-items: start; gap: 13px; }
  .page-head h1 { font-size: 27px; }
  .head-actions { width: 100%; justify-content: flex-start; }
  .head-actions .select { width: min(220px, 100%); max-width: none; flex: 1 1 170px; }
  .head-actions .btn { flex: 0 0 auto; }
  .badge-premium { justify-self: start; align-self: auto; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .stat-card { min-height: 118px; padding: 15px 48px 14px 15px; }
  .stat-icon { top: 13px; right: 13px; width: 31px; height: 31px; }
  .stat-card strong { font-size: 21px; }
  .dashboard-grid { gap: 12px; }
  .panel { padding: 16px; border-radius: 17px; }
  .dash-stage { grid-template-columns: 82px minmax(60px,1fr) auto; gap: 9px; }
  .pipeline-toolbar { align-items: flex-start; }
  .pipeline-toolbar > div:first-child { flex: 1 1 auto; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .pipeline-toolbar > div:first-child::-webkit-scrollbar { display: none; }
  .kanban { min-height: calc(100dvh - 210px); grid-auto-columns: min(82vw, 300px); gap: 10px; }
  .stage-col { min-height: 430px; }
  .table-tools { align-items: flex-start; flex-direction: column; }
  .search-inline { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .migration-hero { padding: 18px; gap: 18px; }
  .migration-features { grid-template-columns: 1fr; }
  .job-row { grid-template-columns: 1fr; gap: 9px; }
  .job-row > div:last-child { grid-column: auto; }
  .drawer-panel { width: min(96vw, 480px); padding: 20px; }
  .login-shell { display: block; background: #fff; }
  .login-panel { min-height: 100dvh; padding: 88px 22px 72px; }
  .brand-login { top: 24px; left: 22px; }
  .login-visual { display: none; }
  .login-foot { position: static; margin-top: 24px; flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 112px; }
  .head-actions { flex-wrap: wrap; }
  .head-actions .select { width: 100%; flex-basis: 100%; }
  .head-actions .btn { flex: 1 1 auto; }
  .pipeline-toolbar { gap: 9px; }
  .sum-chip { font-size: 9px; }
  .drawer-meta { grid-template-columns: 1fr; }
  .modal-card { padding: 20px; }
}

/* v0.3 operational CRM */
.click-row { cursor: pointer; transition: background .16s ease, transform .16s ease; }
.click-row:hover { background: #f7f8fc; }
.drawer-form { margin: 18px 0 20px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fbfcff; }
.drawer-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.drawer-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn-danger-soft { color: #8d3440; border: 1px solid #efd2d7; background: #fff7f8; }
.btn-danger-soft:hover { background: #fcecef; }
.entity-list { display: grid; gap: 8px; margin-top: 12px; }
.entity-list-row { width: 100%; min-width: 0; padding: 12px 13px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 10px; text-align: left; border: 1px solid var(--line); border-radius: 13px; background: #fff; cursor: pointer; transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease; }
.entity-list-row:hover { transform: translateY(-1px); border-color: #cfd4ff; box-shadow: 0 8px 24px rgba(35,46,78,.07); }
.entity-list-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 700; font-size: 10px; }
.entity-list-row b { color: var(--text); font-size: 9px; }
.entity-list-row small { grid-column: 1 / -1; color: var(--muted); font-size: 8px; }
.oauth-zone { margin-top: 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.connected-accounts { margin-top: 14px; display: grid; gap: 8px; }
.account-row { min-width: 0; padding: 11px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid rgba(117,128,255,.18); border-radius: 14px; background: rgba(247,248,255,.82); }
.account-row > div { min-width: 0; display: grid; gap: 3px; }
.account-row b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.account-row small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 8px; }
.job-status { text-transform: uppercase; letter-spacing: .05em; }
.job-status.completed { color: #247e5c; }
.job-status.failed { color: #a34250; }
.job-status.running { color: #5362c9; }
.settings-form { margin: 15px 0 18px; }
.users-list { display: grid; gap: 8px; margin-top: 12px; }
.user-row { min-width: 0; padding: 11px 12px; display: grid; grid-template-columns: 34px minmax(0,1fr) auto auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.user-row > div { min-width: 0; display: grid; gap: 2px; }
.user-row b,.user-row small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row b { font-size: 10px; }
.user-row small { color: var(--muted); font-size: 8px; }
.role-pill { padding: 5px 8px; border-radius: 999px; color: #5863bd; background: #f0f2ff; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.security-note { margin-top: 14px; line-height: 1.6; }
@media (max-width: 780px) {
  .account-row { align-items: stretch; flex-direction: column; }
  .account-row .btn { width: 100%; }
  .user-row { grid-template-columns: 34px minmax(0,1fr) auto; }
  .user-row > span:last-child { grid-column: 2 / -1; }
  .drawer-form { padding: 13px; }
}
.user-row-btn { width: 100%; color: inherit; text-align: left; cursor: pointer; font: inherit; transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease; }
.user-row-btn:hover { transform: translateY(-1px); border-color: #cfd4ff; box-shadow: 0 8px 24px rgba(35,46,78,.06); }
.check-line { display: flex !important; align-items: center; gap: 9px; cursor: pointer; }
.check-line input { width: 17px !important; height: 17px !important; min-height: 0 !important; accent-color: #6671e9; }

/* AdeptCRM v0.4 — functional workspace extensions */
.nav-list{overflow-y:auto;min-height:0;padding-right:4px;scrollbar-width:thin}
.nav-count{margin-left:auto;min-width:20px;height:20px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;font-size:11px;background:rgba(96,132,255,.18);color:#dfe7ff;border:1px solid rgba(122,150,255,.22)}
.notif-btn{position:relative}.notif-btn>b{position:absolute;right:-4px;top:-5px;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:#607df4;color:white;font-size:10px;line-height:18px;border:2px solid #fff}
.task-filters{display:grid;grid-template-columns:minmax(240px,1fr) 220px 180px;gap:12px;margin-bottom:18px;padding:14px}
.task-more{margin-left:auto;border:0;background:transparent;color:var(--muted);cursor:pointer;padding:8px;border-radius:10px}.task-more:hover{background:rgba(255,255,255,.05);color:var(--text)}
.linked-row{width:100%;display:flex;justify-content:space-between;gap:16px;align-items:center;border:1px solid var(--line);background:rgba(255,255,255,.018);padding:12px 14px;border-radius:13px;color:var(--text);text-align:left;cursor:pointer;margin-top:8px}.linked-row:hover{border-color:rgba(111,142,255,.38);background:rgba(94,119,220,.07)}.linked-row b{font-size:12px;color:var(--muted);font-weight:600}
.table-sub{display:block;color:var(--muted);font-size:11px;margin-top:4px}.empty-cell{text-align:center!important;color:var(--muted);padding:36px!important}
.form-divider{border-top:1px solid var(--line);padding-top:16px;margin-top:4px;color:var(--muted)}
.btn-sm{padding:8px 11px!important;min-height:36px!important;font-size:12px!important}
.version-pill{padding:7px 11px;border:1px solid var(--line);border-radius:999px;color:var(--muted);font-size:12px;background:rgba(255,255,255,.025)}

/* Calendar */
.calendar-panel{padding:18px}.calendar-head{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:16px}.calendar-head h2{margin:0;text-transform:capitalize}
.calendar-weekdays,.calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px}.calendar-weekdays{padding:0 4px 8px}.calendar-weekdays span{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);text-align:center}
.calendar-day{min-height:126px;border:1px solid var(--line);background:rgba(255,255,255,.018);border-radius:14px;padding:10px;color:var(--text);text-align:left;cursor:pointer;overflow:hidden;transition:.18s ease}.calendar-day:hover{transform:translateY(-1px);border-color:rgba(112,143,255,.35);background:rgba(91,118,229,.05)}.calendar-day.is-empty{opacity:.2;pointer-events:none}.calendar-day.is-today{box-shadow:inset 0 0 0 1px rgba(103,133,255,.52);background:linear-gradient(180deg,rgba(91,117,226,.085),rgba(255,255,255,.015))}.calendar-number{display:inline-flex;width:27px;height:27px;align-items:center;justify-content:center;border-radius:8px;font-weight:700;font-size:12px;margin-bottom:7px}.is-today .calendar-number{background:#627bf0;color:#fff}.calendar-task{display:block;padding:5px 7px;border-radius:8px;background:rgba(98,123,240,.11);border:1px solid rgba(98,123,240,.15);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:10px;margin:4px 0;color:#42538f}.calendar-task.done{opacity:.48;text-decoration:line-through}.calendar-day small{color:var(--muted);font-size:10px}

/* Analytics */
.analytics-grid{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(300px,.8fr);gap:18px}.analytics-grid>.panel:nth-child(3),.analytics-grid>.panel:nth-child(4){min-height:300px}.analytics-bars{display:grid;gap:15px}.analytic-bar>div{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:7px}.analytic-bar b{font-size:13px}.analytic-bar span{color:var(--muted);font-size:11px}.analytic-bar>i{display:block;height:10px;border-radius:999px;background:rgba(255,255,255,.045);overflow:hidden}.analytic-bar>i>em{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#596ed9,#7f96ff)}
.trend-bars{height:224px;display:flex;align-items:flex-end;gap:10px;padding:12px 0 0}.trend-col{flex:1;min-width:0;text-align:center}.trend-col>div{height:154px;display:flex;align-items:flex-end;justify-content:center;background:linear-gradient(180deg,transparent,rgba(255,255,255,.015));border-radius:10px;padding:0 8px}.trend-col i{display:block;width:100%;border-radius:8px 8px 3px 3px;background:linear-gradient(180deg,#7f96ff,#5368cc);min-height:6px}.trend-col b{display:block;font-size:11px;margin-top:7px}.trend-col small{color:var(--muted);font-size:10px;text-transform:capitalize}
.rank-list{display:grid;gap:7px}.rank-row{display:grid;grid-template-columns:26px minmax(0,1fr) auto;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid rgba(255,255,255,.05)}.rank-row:last-child{border-bottom:0}.rank-row>span{width:25px;height:25px;border-radius:8px;background:rgba(104,130,239,.1);display:grid;place-items:center;font-size:10px;color:#aebcf8}.rank-row b{font-size:12px}.rank-row small{display:block;color:var(--muted);font-size:10px;margin-top:2px}.rank-row strong{font-size:11px;color:#3f4b63}

/* Automations */
.automation-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;margin-bottom:18px;padding:0;overflow:hidden}.automation-summary>div{padding:18px 20px;border-right:1px solid var(--line)}.automation-summary>div:last-child{border-right:0}.automation-summary b{display:block;font-size:12px;margin-bottom:5px}.automation-summary span{font-size:11px;color:var(--muted)}
.automation-list{display:grid;gap:12px}.automation-card{display:grid;grid-template-columns:48px minmax(0,1fr) auto 42px 42px;align-items:center;gap:14px;padding:16px 17px;border:1px solid var(--line);border-radius:16px;background:linear-gradient(180deg,rgba(255,255,255,.026),rgba(255,255,255,.014));box-shadow:0 12px 34px rgba(2,6,20,.12)}.automation-card.disabled{opacity:.55}.automation-icon{width:45px;height:45px;border-radius:13px;display:grid;place-items:center;background:rgba(100,127,238,.12);border:1px solid rgba(100,127,238,.16);font-size:18px}.automation-main h3{margin:2px 0 5px;font-size:15px}.automation-main p{margin:0;color:var(--muted);font-size:11px;line-height:1.5}.switch{position:relative;width:42px;height:24px}.switch input{position:absolute;opacity:0}.switch span{position:absolute;inset:0;border-radius:999px;background:rgba(255,255,255,.1);border:1px solid var(--line);cursor:pointer;transition:.2s}.switch span:after{content:"";position:absolute;width:17px;height:17px;border-radius:50%;left:3px;top:2px;background:#a7b1cb;transition:.2s}.switch input:checked+span{background:rgba(98,123,240,.25);border-color:rgba(98,123,240,.42)}.switch input:checked+span:after{left:20px;background:#8398ff}

/* Notifications */
.notifications-list{display:grid}.notification-row{display:grid;grid-template-columns:13px minmax(0,1fr) auto;gap:13px;align-items:start;width:100%;padding:15px 7px;border:0;border-bottom:1px solid var(--line);background:transparent;color:var(--text);text-align:left;cursor:pointer}.notification-row:last-child{border-bottom:0}.notification-row.unread{background:linear-gradient(90deg,rgba(98,123,240,.055),transparent)}.notification-row:hover{background:rgba(255,255,255,.025)}.notification-row b{font-size:13px}.notification-row p{margin:4px 0 3px;color:var(--muted);font-size:11px;line-height:1.45}.notification-row small{color:#68728e;font-size:10px}.notification-row>span{font-size:9px;color:#9eafff;letter-spacing:.07em}.notif-dot{display:block;width:8px;height:8px;border-radius:50%;margin-top:6px;background:#697792;box-shadow:0 0 0 4px rgba(105,119,146,.08)}.notif-dot.success{background:#61b990}.notif-dot.warning{background:#e5a85d}.notif-dot.error{background:#de6f7b}.notif-dot.automation{background:#7d91f4}
.empty-state{display:flex!important;flex-direction:column;align-items:center;justify-content:center;text-align:center;min-height:190px;gap:6px;color:var(--muted)}.empty-state b{color:var(--text);font-size:15px}

/* Settings */
.settings-tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:18px}.settings-section{display:none}.settings-section.active{display:block}.settings-narrow{max-width:720px}.system-list{display:grid;margin-top:18px}.system-list>div{display:flex;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:1px solid var(--line)}.system-list>div:last-child{border-bottom:0}.system-list span{color:var(--muted);font-size:12px}.system-list b{font-size:12px}
.pipeline-admin-list{display:grid;gap:14px}.pipeline-admin-card{border:1px solid var(--line);border-radius:15px;overflow:hidden;background:rgba(255,255,255,.014)}.pipeline-admin-head{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:13px 14px;border-bottom:1px solid var(--line)}.pipeline-admin-head>div{display:flex;align-items:center;gap:8px}.stage-admin-list{display:grid}.stage-admin-row{display:grid;grid-template-columns:28px minmax(0,1fr) 38px 38px;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid rgba(255,255,255,.045)}.stage-admin-row:last-child{border-bottom:0}.stage-admin-row>span{font-size:10px;color:var(--muted);text-align:center}.stage-admin-row>b{font-size:12px}

@media(max-width:1180px){.analytics-grid{grid-template-columns:1fr}.calendar-day{min-height:110px}.automation-card{grid-template-columns:45px minmax(0,1fr) auto 38px 38px}.task-filters{grid-template-columns:1fr 180px 160px}}
@media(max-width:820px){
  .task-filters{grid-template-columns:1fr}.calendar-panel{padding:12px}.calendar-weekdays,.calendar-grid{gap:4px}.calendar-day{min-height:88px;border-radius:10px;padding:7px}.calendar-task{font-size:9px;padding:4px 5px}.calendar-number{width:23px;height:23px;font-size:10px}.calendar-head{align-items:flex-start;flex-direction:column}.automation-summary{grid-template-columns:1fr}.automation-summary>div{border-right:0;border-bottom:1px solid var(--line)}.automation-summary>div:last-child{border-bottom:0}.automation-card{grid-template-columns:42px minmax(0,1fr) auto}.automation-card>.icon-btn{grid-row:2}.automation-card>.switch{grid-column:3;grid-row:1/3}.analytics-grid{gap:12px}.rank-row{grid-template-columns:24px minmax(0,1fr)}.rank-row strong{grid-column:2}.top-actions .sync-pill{display:none}.settings-tabs{overflow-x:auto;flex-wrap:nowrap;padding-bottom:4px}.settings-tabs .chip{flex:0 0 auto}
}
@media(max-width:520px){.calendar-weekdays span{font-size:9px}.calendar-day{min-height:72px;padding:5px}.calendar-task{display:none}.calendar-day small{display:none}.calendar-head .muted{display:none}.automation-card{padding:13px;gap:10px}.automation-icon{width:38px;height:38px}.notification-row{padding:13px 2px}.topbar .btn{padding-inline:12px}.pipeline-admin-head{align-items:flex-start;flex-direction:column}.pipeline-admin-head>div:last-child{width:100%;justify-content:flex-end}}
.btn-danger-soft{background:rgba(222,111,123,.08)!important;border-color:rgba(222,111,123,.22)!important;color:#eaa1a9!important}.btn-danger-soft:hover{background:rgba(222,111,123,.14)!important}.modal-spacer{flex:1}

/* v0.4 markup compatibility + visual QA fixes */
.dash-stage{width:100%;border:0;padding:0;background:transparent;grid-template-columns:1fr;gap:7px;text-align:left;cursor:pointer}
.dash-stage>div{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0}
.dash-stage>div b{color:#253049;font-size:11px;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dash-stage>div span{color:#7a8499;font-size:10px;text-align:right}
.dash-stage>i{display:block;height:8px;border-radius:999px;background:#edf0f5;overflow:hidden}
.dash-stage>i>em{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#6372eb,#8268ef);min-width:4px}

.kanban-col{min-width:0;min-height:470px;padding:11px;border:1px solid #e0e5ed;border-radius:18px;background:#edf0f5;transition:border-color .16s ease,background .16s ease}
.kanban-col>header{min-width:0;min-height:47px;padding:3px 3px 10px;display:flex;align-items:flex-start;justify-content:space-between;gap:9px}
.kanban-col>header>div{min-width:0;display:flex;align-items:center;gap:7px}
.kanban-col>header>div b{overflow:hidden;color:#263047;font-size:10px;line-height:1.25;text-overflow:ellipsis;white-space:nowrap}
.kanban-col>header>div span{min-width:22px;padding:3px 6px;border-radius:999px;color:#778196;background:#fff;font-size:8px;text-align:center}
.kanban-col>header>strong{flex:0 0 auto;color:#566178;font-size:9px;line-height:1.2;text-align:right}
.kanban-drop{min-height:390px}
.kanban-drop.drag-over{border-radius:12px;background:rgba(101,115,255,.065);box-shadow:inset 0 0 0 1px rgba(101,115,255,.18)}
.empty-drop{padding:18px 10px;color:#9aa3b4;font-size:9px;text-align:center;border:1px dashed #d9dee8;border-radius:12px}
.lead-card-top{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px}.lead-card-top small{color:#9aa3b4;font-size:8px}
.lead-card.priority-high .priority-dot{background:#ed8650}.lead-card.priority-low .priority-dot{background:#49a883}.lead-card.priority-normal .priority-dot{background:#9da6b7}
.lead-card>strong{display:block;margin:10px 0 11px;overflow:hidden;color:#172033;font-size:14px;font-weight:800;text-overflow:ellipsis;white-space:nowrap}
.lead-client{min-width:0;display:flex;align-items:center;gap:8px}.lead-client>div{min-width:0}.lead-client b,.lead-client small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.lead-client b{color:#263047;font-size:9px}.lead-client small{margin-top:3px;color:#8a94a7;font-size:8px}
.lead-card footer{margin-top:10px;padding-top:9px;border-top:1px solid #edf0f5;display:flex;justify-content:space-between;gap:8px;color:#7e899c;font-size:8px}.lead-card footer span,.lead-card footer time{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.task-row{min-width:0;padding:11px 10px;display:grid;grid-template-columns:20px minmax(0,1fr) 28px;align-items:start;gap:9px;border:1px solid var(--line);border-radius:13px;background:#fff}
.task-row.overdue{border-color:#f1cfd3;background:#fffafb}.task-row>div{min-width:0}.task-row b,.task-row small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.task-row b{color:#202a3d;font-size:10px;line-height:1.35}.task-row small{margin-top:4px;color:var(--muted);font-size:8px}.task-row .task-more{align-self:start;font-size:10px;color:#8893a8}
.activity-row{min-width:0;display:flex;gap:10px}.activity-row>i{width:7px;height:7px;flex:0 0 7px;margin-top:5px;border-radius:999px;background:#7180ff;box-shadow:0 0 0 4px #eef0ff}.activity-row>div{min-width:0}.activity-row b,.activity-row small{display:block;overflow:hidden;text-overflow:ellipsis}.activity-row b{color:#202a3d;font-size:9px;line-height:1.35}.activity-row small{margin-top:3px;color:var(--muted);font-size:8px;white-space:nowrap}

@media(max-width:820px){.kanban-col{min-width:250px}.task-row{grid-template-columns:20px minmax(0,1fr) 28px}}

/* v0.4 mobile calendar: keep task editing available without crushing the grid */
@media(max-width:520px){
  .calendar-task{display:inline-block;width:7px;height:7px;min-width:7px;padding:0;margin:2px 2px 0 0;border:0;border-radius:999px;background:#627bf0;color:transparent;font-size:0;line-height:0;vertical-align:top;overflow:hidden}
  .calendar-task.done{opacity:.38;background:#8f9bb3}
}

/* AdeptCRM v0.5 — Russian business UI + deal workspace */
.modal-lg{width:min(820px,calc(100% - 30px))}
.settings-caption{margin:5px 0 0;max-width:620px;line-height:1.55}
.permission-guide{margin-top:18px;padding:15px;border:1px solid var(--line);border-radius:15px;background:#f8f9fc;display:grid;gap:8px}
.permission-guide>b{font-size:12px;color:#202a3d}.permission-guide>span{font-size:10px;line-height:1.5;color:var(--muted)}.permission-guide strong{color:#39435a}
.field-entity-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:16px 0 13px}
.custom-fields-list{display:grid;gap:8px}.custom-field-row{display:grid;grid-template-columns:minmax(0,1fr) auto 38px 38px;gap:10px;align-items:center;padding:12px 13px;border:1px solid var(--line);border-radius:14px;background:#fff}.custom-field-row.disabled{opacity:.55}.custom-field-row>div{min-width:0}.custom-field-row b,.custom-field-row small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.custom-field-row b{font-size:11px;color:#222d42}.custom-field-row small{margin-top:3px;color:var(--muted);font-size:9px}.custom-field-row>span{padding:5px 8px;border-radius:999px;background:#f0f3ff;color:#5966c7;font-size:8px;font-weight:800}
.custom-form-fields:empty{display:none}.custom-form-fields{margin-top:2px;padding-top:13px;border-top:1px solid var(--line)}.custom-fields-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:11px}.custom-fields-title b{font-size:11px;color:#253049}.custom-fields-title span{font-size:9px;color:var(--muted)}.custom-fields-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.custom-fields-grid label{min-width:0}.custom-fields-grid .span-2{grid-column:span 2}

/* Drawer is a real right-side workspace; v0.4 markup has head/body as siblings. */
.drawer.show{display:grid;grid-template-columns:minmax(0,1fr) min(640px,96vw);grid-template-rows:auto 1fr;background:rgba(10,15,25,.45);backdrop-filter:blur(5px)}
.drawer.show:before{content:"";grid-column:1;grid-row:1 / span 2}
.drawer-head{grid-column:2;grid-row:1;padding:20px 24px 15px;display:flex;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid var(--line);background:#fff;box-shadow:-18px 0 45px rgba(9,14,25,.08)}
.drawer-head .kicker{display:block}.drawer-head h2{margin:5px 0 0;color:#1e293b;font-size:18px}
.drawer-body{grid-column:2;grid-row:2;min-width:0;overflow:auto;padding:22px 24px 36px;background:#fff;box-shadow:-18px 25px 45px rgba(9,14,25,.12)}
.entity-hero{min-width:0;display:grid;grid-template-columns:54px minmax(0,1fr);gap:13px;align-items:center;margin-bottom:16px}.entity-avatar{width:54px;height:54px;border-radius:16px;display:grid;place-items:center;background:linear-gradient(135deg,#eef0ff,#e7ebff);color:#5968d7;font-weight:900;font-size:16px;border:1px solid #dce1ff}.entity-hero>div{min-width:0}.entity-hero h2{margin:3px 0 5px;overflow:hidden;text-overflow:ellipsis;color:#1f293b;font-size:22px;line-height:1.15}.entity-hero strong{color:#202a3d;font-size:15px}.entity-hero p{margin:4px 0 0;color:var(--muted);font-size:10px}.entity-hero .kicker{font-size:9px}
.drawer-actions{margin-bottom:17px;padding-bottom:16px;border-bottom:1px solid var(--line)}
.detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.detail-grid>div{min-width:0;padding:11px 12px;border:1px solid var(--line);border-radius:13px;background:#f9fafc}.detail-grid span,.detail-grid b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.detail-grid span{color:var(--muted);font-size:8px}.detail-grid b{margin-top:5px;color:#263147;font-size:10px}
.drawer-section{margin-top:23px;padding-top:20px;border-top:1px solid var(--line)}.drawer-section .panel-head{margin-bottom:12px}.drawer-section h3{margin:3px 0 0;color:#253049;font-size:14px}
.note-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:9px;align-items:end;margin-bottom:13px}.note-form textarea{min-height:72px;resize:vertical}.note-form .btn{height:42px}
.timeline-list{display:grid;gap:8px}.timeline-row{display:grid;grid-template-columns:28px minmax(0,1fr);gap:10px;align-items:start;padding:10px 11px;border:1px solid var(--line);border-radius:13px;background:#fbfcfe}.timeline-row>i{width:27px;height:27px;display:grid;place-items:center;border-radius:9px;background:#eef1ff;color:#6270df;font-style:normal;font-size:11px}.timeline-row.comment>i{background:#fff4e9}.timeline-row>div{min-width:0}.timeline-row b{display:block;color:#273248;font-size:10px}.timeline-row p{margin:5px 0;color:#39455c;font-size:10px;line-height:1.55;overflow-wrap:anywhere}.timeline-row small{display:block;margin-top:4px;color:var(--muted);font-size:8px}
.attachments-list{display:grid;gap:8px}.attachment-row{min-width:0;padding:11px 12px;display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid var(--line);border-radius:13px;background:#fbfcfe}.attachment-row>div:first-child{min-width:0}.attachment-row b,.attachment-row small{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.attachment-row b{color:#273248;font-size:10px}.attachment-row small{margin-top:4px;color:var(--muted);font-size:8px}.attachment-row>div:last-child{display:flex;align-items:center;gap:6px;flex:0 0 auto}.file-upload-btn{cursor:pointer}.upload-hint{display:block;margin-top:8px;font-size:8px;line-height:1.45}

@media(max-width:780px){
  .drawer.show{grid-template-columns:1fr;grid-template-rows:auto 1fr}.drawer.show:before{display:none}.drawer-head,.drawer-body{grid-column:1}.drawer-head{padding:15px 16px 12px}.drawer-body{padding:17px 15px 28px}.entity-hero{grid-template-columns:46px minmax(0,1fr)}.entity-avatar{width:46px;height:46px;border-radius:14px}.entity-hero h2{font-size:19px}.detail-grid{grid-template-columns:1fr 1fr}.note-form{grid-template-columns:1fr}.note-form .btn{width:100%}.attachment-row{align-items:flex-start;flex-direction:column}.attachment-row>div:last-child{width:100%;justify-content:flex-end}.custom-fields-grid{grid-template-columns:1fr}.custom-fields-grid .span-2{grid-column:auto}.custom-field-row{grid-template-columns:minmax(0,1fr) auto 36px 36px}
}
@media(max-width:480px){.detail-grid{grid-template-columns:1fr}.custom-field-row{grid-template-columns:minmax(0,1fr) auto}.custom-field-row>.icon-btn{grid-row:2}.custom-field-row>.icon-btn:last-child{grid-column:2}.permission-guide{padding:12px}}

/* AdeptCRM v0.5.2 — premium local typography refresh */


/* AdeptCRM typography refinement — Manrope UI */
body {
  font-family: var(--font-ui);
  font-weight: 500;
  letter-spacing: -0.010em;
  font-optical-sizing: auto;
}

.brand strong,
.page-head h1,
.panel-head h2,
.migration-copy h2,
.settings-grid h2,
.entity-hero h2,
.login-copy h1,
.modal-card h2,
.drawer-head h2,
.automation-main h3,
.empty-state b {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.032em;
}

.page-head h1 {
  font-weight: 700;
  letter-spacing: -0.048em;
  line-height: 1.02;
}

.brand strong {
  font-weight: 700;
  letter-spacing: -0.024em;
}

.stat-card strong,
.lead-amount,
.lead-card > strong,
.entity-hero strong,
.analytics-value,
.metric-value,
.dash-stage b,
.rank-row strong {
  font-family: var(--font-data);
  font-weight: 700;
  letter-spacing: -0.030em;
  font-variant-numeric: tabular-nums lining-nums;
}

.nav-item,
.btn,
.link-btn,
.role-pill,
.eyebrow,
.kicker {
  font-family: var(--font-ui);
}

.nav-item { font-weight: 500; letter-spacing: -0.012em; }
.nav-item.active { font-weight: 700; }
.btn { font-weight: 700; letter-spacing: -0.014em; }
.eyebrow, .kicker { font-weight: 700; letter-spacing: .11em; }

input,
textarea,
select,
table,
button {
  font-family: var(--font-ui);
  font-weight: 500;
  letter-spacing: -0.010em;
}

.page-head p,
.stat-card small,
.stat-card > span:not(.stat-icon),
.panel p,
.muted,
.timeline-row p,
.automation-main p {
  font-weight: 400;
  letter-spacing: -0.006em;
}
