/*
  Nova Partners CRM · demo by FROMOLDED
  Light SaaS admin: navy sidebar, white cards, indigo accent. Flat CSS, no nesting.
*/

:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --col-bg: #eef0f5;
  --line: #e6e8ef;
  --line-2: #eef0f4;
  --line-strong: #d6d9e3;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --navy: #0f172a;
  --navy-2: #1e293b;
  --accent: #5b5bf6;
  --accent-600: #4a4ae6;
  --accent-700: #3f3fc9;
  --accent-50: #eff0ff;
  --accent-100: #e2e3ff;
  --accent-ring: rgba(91, 91, 246, 0.18);
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 14px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.14), 0 3px 8px rgba(15, 23, 42, 0.06);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --sb-w: 232px;
  --font: "Inter", -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: inherit;
}

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

ul,
ol {
  list-style: none;
}

a {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.num,
.tnum {
  font-variant-numeric: tabular-nums;
}

/* ——— App shell ——— */
.app {
  display: flex;
  min-height: 100vh;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ——— Sidebar ——— */
.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: var(--sb-w);
  height: 100vh;
  background: var(--navy);
  color: #cbd5e1;
}

.sidebar__bar {
  display: flex;
  align-items: center;
  padding: 20px 18px 8px;
}

.sidebar__burger,
.sidebar__close {
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: #e2e8f0;
}

.sidebar__burger:hover,
.sidebar__close:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sidebar__burger .ico,
.sidebar__close .ico {
  width: 22px;
  height: 22px;
}

.sidebar__panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 6px 12px 16px;
}

.sidebar__panel-head {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
}

.brand__mark {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(140deg, #8b8bff 0%, #5b5bf6 50%, #4338ca 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(91, 91, 246, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.brand__mark svg {
  width: 19px;
  height: 19px;
}

.brand__name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand__tag {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(165, 166, 255, 0.16);
  color: #c7c8ff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.nav {
  flex: 1;
  overflow-y: auto;
}

.nav__label {
  margin: 20px 0 6px;
  padding: 0 10px;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  height: 38px;
  margin-bottom: 2px;
  padding: 0 10px;
  border-radius: 9px;
  color: #cbd5e1;
  font-size: 13.5px;
  font-weight: 500;
  transition: background-color 0.15s, color 0.15s;
}

.nav__item .ico {
  color: #8391a7;
  transition: color 0.15s;
}

.nav__item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav__item:hover .ico {
  color: #cbd5e1;
}

.nav__item.is-active {
  background: rgba(124, 124, 255, 0.16);
  color: #fff;
}

.nav__item.is-active .ico {
  color: #a5a6ff;
}

.nav__item.is-active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #8b8bff;
}

.nav__item:focus-visible {
  outline-color: #a5a6ff;
  outline-offset: 0;
}

.nav__count {
  margin-left: auto;
  color: #8391a7;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.nav__badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.sidebar__foot {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
}

.me__who {
  min-width: 0;
}

.me__who b {
  display: block;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}

.me__who span {
  display: block;
  color: #8391a7;
  font-size: 12px;
}

.credit {
  margin-top: 12px;
  padding: 0 8px;
  color: #64748b;
  font-size: 11.5px;
  line-height: 1.5;
}

.credit a {
  color: #a5b4fc;
  font-weight: 600;
  text-decoration: none;
}

.credit a:hover {
  text-decoration: underline;
}

.scrim {
  display: none;
}

/* ——— Avatars ——— */
.avatar {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.avatar--xs {
  width: 20px;
  height: 20px;
  font-size: 8.5px;
}

.avatar--md {
  width: 28px;
  height: 28px;
  font-size: 10.5px;
}

.avatar--me {
  width: 34px;
  height: 34px;
  background: linear-gradient(140deg, #8b8bff, #5b5bf6);
  font-size: 12px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.avatar--all {
  background: #e9ebf2;
  color: var(--muted);
}

.avatar--all .ico {
  width: 13px;
  height: 13px;
}

.pav {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.pav--lg {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-size: 18px;
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

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

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

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

.btn .ico {
  width: 17px;
  height: 17px;
}

.btn--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(63, 63, 201, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.btn--primary:hover {
  border-color: var(--accent-600);
  background: var(--accent-600);
}

.btn--primary:disabled:hover {
  border-color: var(--accent);
  background: var(--accent);
}

.btn--primary .ico {
  stroke-width: 2.2;
}

.btn--sm {
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
}

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--text-2);
  transition: background-color 0.15s, color 0.15s;
}

.icon-btn:hover {
  background: #eef0f5;
  color: var(--text);
}

.icon-btn .ico {
  width: 20px;
  height: 20px;
}

.link-btn {
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 6px;
}

.link-btn:hover {
  color: var(--accent-700);
  text-decoration: underline;
}

.link-btn:disabled {
  color: var(--faint);
  text-decoration: none;
  cursor: default;
}

/* ——— Top bar ——— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
}

.search {
  position: relative;
  flex: 1;
  max-width: 440px;
}

.search__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  margin-top: -9px;
  color: var(--faint);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 38px;
  padding: 0 56px 0 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 13.5px;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.search input::placeholder {
  color: var(--faint);
}

.search input::-webkit-search-cancel-button,
.search input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.search input:hover {
  border-color: var(--line-strong);
}

.search input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.search__kbd {
  position: absolute;
  right: 9px;
  top: 50%;
  margin-top: -11px;
  height: 22px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 19px;
  pointer-events: none;
}

.search__clear {
  position: absolute;
  right: 6px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: -14px;
  border-radius: 7px;
  color: var(--muted);
}

.search__clear:hover {
  background: #eef0f5;
  color: var(--text);
}

.search__clear .ico {
  width: 16px;
  height: 16px;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.topbar__mgr {
  width: 196px;
}

/* ——— Custom select ——— */
.sel {
  position: relative;
}

.sel__btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 38px;
  padding: 0 10px 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.sel__btn:hover {
  border-color: var(--line-strong);
}

.sel__btn:focus-visible,
.sel__btn[aria-expanded="true"] {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.sel__prefix {
  flex-shrink: 0;
  color: var(--muted);
  font-weight: 500;
}

.sel__val {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sel__val > span:last-child {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sel__chev {
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: transform 0.18s var(--ease);
}

.sel__btn[aria-expanded="true"] .sel__chev {
  transform: rotate(180deg);
}

.sel__list {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  max-height: 290px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  outline: none;
  animation: popIn 0.14s var(--ease);
}

.sel__list.is-up {
  top: auto;
  bottom: calc(100% + 6px);
}

.sel--right .sel__list {
  left: auto;
  right: 0;
}

.sel__opt {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  font-size: 13.5px;
  white-space: nowrap;
  cursor: pointer;
}

.sel__opt.is-active {
  background: #f1f3f8;
}

.sel__opt[aria-selected="true"] {
  font-weight: 600;
}

.sel__check {
  width: 16px;
  height: 16px;
  margin-left: auto;
  padding-left: 0;
  color: var(--accent);
  stroke-width: 2.4;
  visibility: hidden;
}

.sel__opt[aria-selected="true"] .sel__check {
  visibility: visible;
}

.sel__opt .sel__check {
  margin-left: auto;
}

.sel__opt > span:nth-last-child(2) {
  margin-right: 14px;
}

.dot {
  display: inline-block;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}

/* ——— Notifications ——— */
.notif {
  position: relative;
}

.notif__dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 2px #fff;
}

.notif__dot.is-off {
  display: none;
}

.notif__btn[aria-expanded="true"] {
  background: #eef0f5;
  color: var(--text);
}

.pop {
  position: fixed;
  z-index: 60;
  width: 360px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.16s var(--ease);
}

.pop__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px 11px;
  border-bottom: 1px solid var(--line-2);
}

.pop__head b {
  font-size: 14px;
  font-weight: 600;
}

.notif__item {
  position: relative;
  display: flex;
  gap: 12px;
  width: 100%;
  padding: 12px 34px 12px 16px;
  text-align: left;
  transition: background-color 0.12s;
}

.notif__list li + li .notif__item {
  border-top: 1px solid var(--line-2);
}

.notif__item:hover {
  background: var(--surface-2);
}

.notif__item:focus-visible {
  outline-offset: -2px;
}

.notif__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.notif__icon .ico {
  width: 18px;
  height: 18px;
}

.notif__text {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
}

.notif__text b {
  color: var(--text);
  font-weight: 600;
}

.notif__time {
  margin-top: 3px;
  color: var(--faint);
  font-size: 12px;
}

.notif__unread {
  position: absolute;
  top: 50%;
  right: 16px;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--accent);
}

.notif__item.is-read .notif__unread {
  display: none;
}

.notif__item.is-read .notif__text {
  color: var(--muted);
}

.pop__foot {
  padding: 10px 16px;
  border-top: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
}

/* tinted icon tiles, shared */
.tint--indigo {
  background: var(--accent-50);
  color: var(--accent);
}

.tint--amber {
  background: #fef3dc;
  color: #b45309;
}

.tint--green {
  background: #e3f6ea;
  color: #15803d;
}

.tint--sky {
  background: #e0f2fe;
  color: #0369a1;
}

.tint--slate {
  background: #f1f3f8;
  color: #475569;
}

/* ——— Page ——— */
.page {
  flex: 1;
  padding: 26px 28px 40px;
}

.page__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page__sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

.sync {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 9px;
  height: 32px;
  padding: 0 13px 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
}

.sync b {
  color: var(--text);
  font-weight: 600;
}

.sync__dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.sync__dot::after {
  content: "";
  position: absolute;
  left: -4px;
  top: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  background: var(--success);
  opacity: 0.25;
  animation: ping 2s var(--ease) infinite;
}

@keyframes ping {
  0% {
    transform: scale(0.5);
    opacity: 0.45;
  }
  80%,
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

.page__credit {
  display: none;
  margin-top: 28px;
  color: var(--faint);
  font-size: 12px;
  text-align: center;
}

.page__credit a {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.page__credit a:hover {
  color: var(--accent);
}

/* ——— Stats ——— */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0 24px;
}

.stat {
  min-width: 0;
  padding: 16px 18px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

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

.stat__label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.stat__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.stat__icon .ico {
  width: 17px;
  height: 17px;
}

.stat__icon--indigo {
  background: var(--accent-50);
  color: var(--accent);
}

.stat__icon--amber {
  background: #fef3dc;
  color: #b45309;
}

.stat__icon--sky {
  background: #e0f2fe;
  color: #0369a1;
}

.stat__icon--green {
  background: #e3f6ea;
  color: #15803d;
}

.stat__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.stat__value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat__row .stat__value {
  margin-top: 0;
}

.stat__value.is-bump {
  animation: bump 0.5s var(--ease);
}

@keyframes bump {
  30% {
    color: var(--accent);
    transform: translateY(-2px);
  }
}

.stat__sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 20px;
  padding: 0 6px 0 4px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.delta .ico {
  width: 13px;
  height: 13px;
  stroke-width: 2.4;
}

.delta--up {
  background: #e3f6ea;
  color: #15803d;
}

.delta--down {
  background: #fdecec;
  color: #b91c1c;
}

.delta--down .ico {
  transform: rotate(180deg);
}

.spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 28px;
}

.spark i {
  display: block;
  width: 6px;
  min-height: 3px;
  border-radius: 2px 2px 0 0;
  background: var(--accent-100);
  transition: height 0.3s var(--ease);
}

.spark i.is-today {
  background: var(--accent);
}

/* ——— Toolbar ——— */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.toolbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar__count {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: #e8eaf1;
}

.seg__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 13px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.seg__btn .ico {
  width: 16px;
  height: 16px;
}

.seg__btn:hover {
  color: var(--text);
}

.seg__btn.is-on {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(15, 23, 42, 0.03);
}

.seg__btn:focus-visible {
  outline-offset: 0;
}

.seg--block {
  display: flex;
  width: 100%;
}

.seg--block .seg__btn {
  flex: 1;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.filter-chip .ico {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.filter-chip:hover {
  border-color: var(--line-strong);
}

.filter-chip[aria-pressed="true"] {
  border-color: #b9baf9;
  background: var(--accent-50);
  color: var(--accent-700);
}

.filter-chip[aria-pressed="true"] .ico {
  color: var(--accent);
}

/* ——— Board ——— */
.board {
  display: flex;
  align-items: stretch;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.board.is-dragging {
  scroll-snap-type: none !important;
}

.col {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-width: 200px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--col-bg);
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.col.is-over {
  border-color: #c3c4fa;
  background: #e8e9fc;
  box-shadow: 0 0 0 3px rgba(91, 91, 246, 0.08);
}

.col__head {
  padding: 12px 12px 10px 14px;
}

.col__row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
}

.col__name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}

.col__count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff;
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 1px var(--line);
}

.col__add {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-left: auto;
  border-radius: 7px;
  color: var(--muted);
}

.col__add:hover {
  background: #fff;
  color: var(--accent);
}

.col__add .ico {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.col__sum {
  margin-top: 3px;
  padding-left: 16px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col__sum b {
  color: var(--text-2);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.col__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-height: 96px;
  padding: 0 8px 8px;
}

.col__empty {
  display: grid;
  place-items: center;
  min-height: 84px;
  border: 1.5px dashed #d3d6e0;
  border-radius: 11px;
  color: var(--faint);
  font-size: 12.5px;
  font-weight: 500;
}

.col__empty-drop {
  display: none;
}

.board.is-dragging .col__empty-idle {
  display: none;
}

.board.is-dragging .col__empty-drop {
  display: inline;
}

.col__more {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px dashed #cdd0db;
  border-radius: 10px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.col__more .ico {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

.col__more b {
  color: var(--text-2);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.col__more:hover {
  border-color: #b9baf9;
  background: rgba(255, 255, 255, 0.75);
  color: var(--accent-700);
}

.col__more:hover b {
  color: var(--accent-700);
}

/* ——— Partner card ——— */
.card {
  position: relative;
  padding: 11px 12px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.2s var(--ease);
}

.card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card.is-pressing {
  transform: scale(0.975);
}

.card.is-dragging {
  display: none;
}

.card__top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.card__name {
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.card__time {
  flex-shrink: 0;
  padding-top: 1px;
  color: var(--faint);
  font-size: 11.5px;
  white-space: nowrap;
}

.card__handle {
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 9px;
}

.card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 8px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line-2);
  font-size: 12px;
}

.card__vol {
  color: var(--muted);
  white-space: nowrap;
}

.card__vol b {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.card__deal {
  color: var(--text-2);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.card__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
}

.card__mgr {
  margin-left: auto;
}

.card.is-flash {
  animation: cardFlash 1.8s var(--ease);
}

.card.is-new {
  animation: cardIn 0.45s var(--ease), cardFlash 2.4s var(--ease) 0.1s;
}

@keyframes cardFlash {
  0%,
  35% {
    border-color: var(--accent);
    background: #f6f6ff;
    box-shadow: 0 0 0 3px rgba(91, 91, 246, 0.22), 0 6px 16px rgba(91, 91, 246, 0.14);
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
  }
}

/* drag & drop */
.ph {
  flex-shrink: 0;
  border: 1.5px dashed #a9aaf7;
  border-radius: 11px;
  background: rgba(91, 91, 246, 0.07);
}

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 200;
  pointer-events: none;
  will-change: transform;
}

.ghost.is-dropping {
  transition: transform 0.2s var(--ease);
}

.ghost .card {
  cursor: grabbing;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s;
}

.ghost .card.is-lifted {
  border-color: #c3c4fa;
  transform: rotate(2.5deg) scale(1.035);
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.2), 0 6px 14px rgba(15, 23, 42, 0.1);
}

body.is-grabbing,
body.is-grabbing * {
  cursor: grabbing !important;
}

body.is-grabbing {
  -webkit-user-select: none;
  user-select: none;
}

/* ——— Tags, GEO, chips ——— */
.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.src-facebook {
  background: #e7eeff;
  color: #1d4ed8;
}

.src-uac {
  background: #e2f5e8;
  color: #15803d;
}

.src-tiktok {
  background: #fde8f1;
  color: #be185d;
}

.src-seo {
  background: #efe9ff;
  color: #6d28d9;
}

.src-telegram {
  background: #def2fc;
  color: #0369a1;
}

.src-push {
  background: #fdf0d5;
  color: #b45309;
}

.dot--facebook {
  background: #3b6ef5;
}

.dot--uac {
  background: #22a35a;
}

.dot--tiktok {
  background: #e0438a;
}

.dot--seo {
  background: #8b5cf6;
}

.dot--telegram {
  background: #1aa0e0;
}

.dot--push {
  background: #f0a020;
}

.geo {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 5px;
  border: 1px solid #e1e4ec;
  border-radius: 5px;
  background: #f6f7fa;
  color: #334155;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.geos {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.bot-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 21px;
  padding: 0 8px 0 6px;
  border-radius: 999px;
  background: var(--accent-50);
  color: #4338ca;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.bot-chip .ico {
  width: 13px;
  height: 13px;
  stroke-width: 2;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill--new {
  background: var(--accent-50);
  color: #4343d6;
}

.pill--contacted {
  background: #e0f2fe;
  color: #0369a1;
}

.pill--testing {
  background: #fef3dc;
  color: #b45309;
}

.pill--active {
  background: #e3f6ea;
  color: #15803d;
}

.pill--paused {
  background: #eef0f4;
  color: #64748b;
}

/* ——— Table ——— */
.table-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.table-scroll {
  overflow-x: auto;
}

.tbl {
  width: 100%;
  min-width: 960px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.tbl th {
  padding: 0;
  border-bottom: 1px solid var(--line);
  background: #fafbfd;
  color: var(--muted);
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.th-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 11px 14px;
  font-size: 12px;
  font-weight: 600;
  transition: color 0.15s;
}

.th-btn:hover {
  color: var(--text);
}

.th-btn:focus-visible {
  outline-offset: -2px;
}

.th-btn .ico {
  width: 14px;
  height: 14px;
  opacity: 0.5;
  stroke-width: 2;
}

.tbl th[aria-sort] .th-btn {
  color: var(--text);
}

.tbl th[aria-sort] .ico {
  color: var(--accent);
  opacity: 1;
}

.tbl th[aria-sort="descending"] .ico {
  transform: rotate(180deg);
}

.tbl th.num .th-btn {
  justify-content: flex-end;
}

.tbl td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-2);
  color: var(--text-2);
  vertical-align: middle;
  white-space: nowrap;
}

.tbl tbody tr {
  cursor: pointer;
  transition: background-color 0.12s;
}

.tbl tbody tr:last-child td {
  border-bottom: 0;
}

.tbl tbody tr:hover {
  background: #f8f9fd;
}

.tbl tbody tr:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.tbl tbody tr.is-flash {
  animation: rowFlash 1.8s var(--ease);
}

.tbl tbody tr.is-new {
  animation: rowFlash 2.4s var(--ease);
}

@keyframes rowFlash {
  0%,
  35% {
    background: #eff0ff;
  }
}

.tbl .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tbl td.num {
  color: var(--text);
  font-weight: 600;
}

.cell-partner {
  display: flex;
  align-items: center;
  gap: 11px;
}

.cell-partner b {
  display: block;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
}

.cell-partner span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.mini-bot {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #4343d6;
  font-weight: 600;
}

.mini-bot .ico {
  width: 13px;
  height: 13px;
}

.cell-mgr {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cell-deal {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

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

.table-foot {
  padding: 11px 16px;
  border-top: 1px solid var(--line-2);
  background: #fafbfd;
  color: var(--muted);
  font-size: 12.5px;
}

/* ——— Empty state ——— */
.empty {
  padding: 60px 24px 64px;
  border: 1.5px dashed #d3d6e0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
  text-align: center;
}

.empty__icon {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  border-radius: 15px;
  background: var(--accent-50);
  color: var(--accent);
}

.empty__icon .ico {
  width: 24px;
  height: 24px;
}

.empty__title {
  font-size: 16px;
  font-weight: 600;
}

.empty__text {
  max-width: 360px;
  margin: 6px auto 18px;
  color: var(--muted);
  font-size: 13.5px;
}

/* ——— Overlay + drawer ——— */
.overlay {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.36);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s var(--ease), visibility 0.28s;
}

.overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  width: 520px;
  max-width: 100%;
  background: #fff;
  box-shadow: -24px 0 60px rgba(15, 23, 42, 0.16);
  outline: none;
  transform: translateX(104%);
  visibility: hidden;
  transition: transform 0.34s var(--ease), visibility 0s linear 0.34s;
}

.drawer.is-open {
  transition: transform 0.34s var(--ease), visibility 0s;
  transform: none;
  visibility: visible;
}

.dw-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 20px 18px 24px;
  border-bottom: 1px solid var(--line);
}

.dw-id {
  flex: 1;
  min-width: 0;
  padding-top: 3px;
}

.dw-id h2 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.dw-handle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.dw-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 32px;
  overscroll-behavior: contain;
}

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

.dw-controls .field {
  margin-bottom: 0;
}

.dw-contacts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.contact {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.contact:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.contact:disabled {
  cursor: default;
  opacity: 0.6;
}

.contact:disabled:hover {
  border-color: var(--line);
  background: #fff;
}

.contact__ico {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.contact__ico .ico {
  width: 18px;
  height: 18px;
}

.contact__txt {
  flex: 1;
  min-width: 0;
}

.contact__txt small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}

.contact__txt b {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.contact__aux {
  width: 16px;
  height: 16px;
  color: var(--faint);
}

.dw-sec {
  margin-top: 26px;
}

.dw-sec__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.dw-sec__title span {
  color: var(--faint);
  font-size: 12px;
  font-weight: 500;
}

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}

.fact {
  min-width: 0;
  padding: 10px 13px 11px;
  background: #fff;
}

.fact dt {
  color: var(--muted);
  font-size: 11.5px;
}

.fact dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  margin-top: 4px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.fact dd small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

/* deal editor */
.deal__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.deal__fields .field {
  margin-bottom: 0;
}

.deal__hint {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12.5px;
}

.deal__hint .ico {
  width: 15px;
  height: 15px;
  margin-top: 1px;
  color: var(--faint);
}

.deal__hint:empty {
  display: none;
}

/* performance */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.kpi {
  min-width: 0;
  padding: 10px 12px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.kpi__k {
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.kpi__v {
  margin-top: 3px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.kpi__s {
  margin-top: 1px;
  overflow: hidden;
  color: var(--faint);
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.chart {
  position: relative;
  margin-top: 10px;
  padding: 12px 14px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.chart__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
}

.chart__head span {
  color: var(--muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.chart__plot {
  position: relative;
  margin-top: 4px;
}

.chart__plot svg {
  display: block;
  overflow: visible;
}

.bar {
  outline: none;
  cursor: default;
}

.bar__mark {
  fill: var(--accent);
  transition: opacity 0.15s, fill 0.15s;
}

.bar__zero {
  fill: #d6d9e3;
}

.bar__val {
  fill: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
}

.bar__lbl {
  fill: var(--muted);
  font-size: 11px;
  font-family: var(--font);
}

.chart__base {
  stroke: var(--line);
  stroke-width: 1;
}

.chart__plot.has-hover .bar:not(.is-hover) .bar__mark {
  opacity: 0.4;
}

.bar.is-hover .bar__mark,
.bar:focus .bar__mark {
  fill: var(--accent-600);
}

.bar:focus-visible .bar__hit {
  stroke: var(--accent);
  stroke-width: 1.5;
}

.chart__tip {
  position: absolute;
  z-index: 3;
  padding: 7px 10px 8px;
  border-radius: 9px;
  background: var(--navy);
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.45;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, -100%);
  font-variant-numeric: tabular-nums;
}

.chart__tip b {
  display: block;
  color: #fff;
  font-weight: 600;
}

.perf-empty {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1.5px dashed #d8dbe4;
  border-radius: 12px;
  background: var(--surface-2);
}

.perf-empty .notif__icon {
  width: 40px;
  height: 40px;
}

.perf-empty b {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
}

.perf-empty p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
}

/* notes + timeline */
.composer {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.composer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.composer textarea {
  display: block;
  width: 100%;
  min-height: 64px;
  padding: 8px 10px;
  border: 0;
  background: none;
  font-size: 13.5px;
  line-height: 1.5;
  resize: vertical;
}

.composer textarea:focus {
  outline: none;
}

.composer textarea::placeholder {
  color: var(--faint);
}

.composer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 4px 4px 10px;
}

.composer__hint {
  color: var(--faint);
  font-size: 12px;
}

.tl {
  margin-top: 18px;
}

.tl__item {
  position: relative;
  display: flex;
  gap: 12px;
  padding-bottom: 16px;
}

.tl__item::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 32px;
  bottom: 2px;
  width: 1px;
  background: var(--line);
}

.tl__item:last-child {
  padding-bottom: 0;
}

.tl__item:last-child::before {
  display: none;
}

.tl__item.is-new {
  animation: tlIn 0.5s var(--ease);
}

@keyframes tlIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.tl__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 29px;
  height: 29px;
  border-radius: 50%;
}

.tl__icon .ico {
  width: 15px;
  height: 15px;
}

.tl__body {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
}

.tl__text {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.tl__text b {
  font-weight: 600;
}

.tl__note {
  margin-top: 6px;
  padding: 9px 11px;
  border: 1px solid #f6e3b0;
  border-radius: 10px;
  background: #fffaeb;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.tl__meta {
  margin-top: 2px;
  color: var(--faint);
  font-size: 12px;
}

.dw-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px 14px 24px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.dw-state {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--faint);
  font-size: 12.5px;
}

.dw-state::before {
  content: "";
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
}

.dw-state.is-dirty {
  color: #b45309;
}

.dw-state.is-dirty::before {
  background: var(--warning);
}

.dw-state.is-saved {
  color: #15803d;
}

.dw-state.is-saved::before {
  background: var(--success);
}

.dw-state.is-error {
  color: #dc2626;
}

.dw-state.is-error::before {
  background: var(--danger);
}

/* ——— Forms ——— */
.field {
  min-width: 0;
  margin-bottom: 16px;
  padding: 0;
  border: 0;
}

.label {
  display: block;
  margin-bottom: 6px;
  padding: 0;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
}

.label__hint {
  margin-left: 4px;
  color: var(--faint);
  font-weight: 500;
}

.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder {
  color: var(--faint);
}

.input:hover {
  border-color: var(--line-strong);
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

input[type="number"] {
  -moz-appearance: textfield;
  font-variant-numeric: tabular-nums;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.field.is-invalid .input,
.input.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.field__err {
  margin-top: 6px;
  color: #dc2626;
  font-size: 12px;
  font-weight: 500;
}

.field__err:empty {
  display: none;
}

.affix {
  position: relative;
}

.affix__pre,
.affix__post {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 13.5px;
  pointer-events: none;
}

.affix__pre {
  left: 12px;
}

.affix__post {
  right: 12px;
  font-size: 12.5px;
}

.affix--pre .input {
  padding-left: 26px;
}

.affix--post .input {
  padding-right: 70px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.geo-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.geo-opt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}

.geo-opt .ico {
  display: none;
  width: 14px;
  height: 14px;
  margin-left: -2px;
  stroke-width: 2.6;
}

.geo-opt:hover {
  border-color: var(--line-strong);
}

.geo-opt[aria-pressed="true"] {
  border-color: #a9aaf7;
  background: var(--accent-50);
  color: var(--accent-700);
}

.geo-opt[aria-pressed="true"] .ico {
  display: block;
}

.field.is-invalid .geo-opt {
  border-color: #f5b5b5;
}

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

.mgr-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.12s, border-color 0.12s, box-shadow 0.12s;
}

.mgr-opt span:last-child {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mgr-opt:hover {
  border-color: var(--line-strong);
}

.mgr-opt[aria-checked="true"] {
  border-color: var(--accent);
  background: var(--accent-50);
  box-shadow: inset 0 0 0 1px var(--accent);
  font-weight: 600;
}

/* ——— Modal ——— */
.modal-root {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-scrim {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  animation: fadeIn 0.22s var(--ease);
}

.modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 580px;
  max-height: calc(100vh - 48px);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.32);
  animation: modalIn 0.28s var(--ease);
}

.modal-root.is-closing .modal-scrim {
  opacity: 0;
  transition: opacity 0.18s;
}

.modal-root.is-closing .modal {
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.18s, transform 0.18s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 18px 6px 24px;
}

.modal__head h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.modal__head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.modal__form {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 24px 6px;
}

.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px 18px;
  border-top: 1px solid var(--line-2);
}

.modal.is-shake {
  animation: shake 0.36s;
}

@keyframes shake {
  20%,
  60% {
    transform: translateX(-5px);
  }
  40%,
  80% {
    transform: translateX(5px);
  }
}

/* ——— Toasts ——— */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 10px 16px 10px 11px;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
  animation: toastIn 0.3s var(--ease);
  transition: opacity 0.25s, transform 0.25s;
}

.toast.is-out {
  opacity: 0;
  transform: translateY(8px);
}

.toast__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(74, 222, 128, 0.16);
  color: #4ade80;
}

.toast__icon .ico {
  width: 14px;
  height: 14px;
  stroke-width: 2.6;
}

.toast__icon--info {
  background: rgba(165, 166, 255, 0.18);
  color: #a5a6ff;
}

.toast__icon--info .ico {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
}

/* ——— ≤1280: a bit tighter ——— */
@media (max-width: 1280px) {
  .page {
    padding: 24px 24px 36px;
  }

  .topbar {
    padding: 0 24px;
  }

  .stats {
    gap: 12px;
  }

  .stat__sub {
    flex-wrap: wrap;
    line-height: 1.35;
    white-space: normal;
  }

  /* the board scrolls sideways here anyway, so keep cards comfortable */
  .col {
    min-width: 236px;
  }
}

/* ——— ≤1024: icon sidebar ——— */
@media (max-width: 1024px) {
  :root {
    --sb-w: 72px;
  }

  .sidebar__bar {
    justify-content: center;
    padding: 18px 0 8px;
  }

  .sidebar__panel {
    padding: 6px 0 14px;
  }

  .sidebar .brand__name,
  .sidebar .brand__tag,
  .nav__text,
  .nav__label,
  .nav__count,
  .me__who,
  .credit {
    display: none;
  }

  .nav {
    overflow: visible;
    padding-top: 14px;
  }

  .nav__item {
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0 auto 6px;
    padding: 0;
  }

  .nav__item .ico {
    width: 20px;
    height: 20px;
  }

  .nav__item.is-active::before {
    left: -14px;
  }

  .nav__badge {
    position: absolute;
    top: 4px;
    right: 3px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    font-size: 10px;
    box-shadow: 0 0 0 2px var(--navy);
  }

  .nav__item::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    z-index: 5;
    padding: 6px 9px;
    border-radius: 7px;
    background: var(--navy-2);
    color: #fff;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transform: translate(-4px, -50%);
    transition: opacity 0.15s, transform 0.15s;
  }

  .nav__item:hover::after,
  .nav__item:focus-visible::after {
    opacity: 1;
    transform: translate(0, -50%);
  }

  .sidebar__foot {
    margin: 0 12px;
  }

  .me {
    justify-content: center;
    padding: 4px 0;
  }

  .page__credit {
    display: block;
  }

  .page__sub {
    font-size: 13.5px;
  }

  .stat__value {
    font-size: 25px;
  }
}

/* ——— ≤900: wrap the header ——— */
@media (max-width: 900px) {
  .page__head {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .topbar__mgr {
    width: 170px;
  }
}

/* ——— ≤760: mobile ——— */
@media (max-width: 760px) {
  body {
    font-size: 14px;
  }

  .app {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 45;
    width: auto;
    height: 56px;
    flex-direction: row;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04), 0 4px 16px rgba(15, 23, 42, 0.18);
  }

  .sidebar__bar {
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
    height: 56px;
    padding: 0 12px 0 8px;
  }

  .sidebar__burger,
  .sidebar__close {
    display: grid;
  }

  .sidebar .brand__name,
  .sidebar .brand__tag {
    display: inline-block;
  }

  .brand__mark {
    width: 30px;
    height: 30px;
  }

  .sidebar__panel {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 70;
    width: 300px;
    max-width: 86vw;
    padding: 0 12px 18px;
    overflow-y: auto;
    background: var(--navy);
    box-shadow: 24px 0 60px rgba(2, 6, 23, 0.35);
    transform: translateX(-104%);
    visibility: hidden;
    transition: transform 0.3s var(--ease), visibility 0s linear 0.3s;
  }

  body.nav-open .sidebar__panel {
    transition: transform 0.3s var(--ease), visibility 0s;
    transform: none;
    visibility: visible;
  }

  .sidebar__panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    padding: 0 0 0 6px;
  }

  .nav__text,
  .nav__label,
  .nav__count,
  .me__who,
  .credit {
    display: block;
  }

  .nav__count {
    display: inline;
  }

  .nav {
    overflow: visible;
    padding-top: 0;
  }

  .nav__item {
    justify-content: flex-start;
    width: 100%;
    height: 44px;
    margin: 0 0 2px;
    padding: 0 12px;
    font-size: 14.5px;
  }

  .nav__item::after {
    display: none;
  }

  .nav__item.is-active::before {
    left: -12px;
  }

  .nav__badge {
    position: static;
    box-shadow: none;
    min-width: 20px;
    height: 20px;
    font-size: 11px;
  }

  .sidebar__foot {
    margin: 16px 0 0;
  }

  .me {
    justify-content: flex-start;
    padding: 4px 8px;
  }

  .scrim {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    display: block;
    background: rgba(15, 23, 42, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
  }

  body.nav-open .scrim {
    opacity: 1;
    visibility: visible;
  }

  .topbar {
    position: static;
    flex-wrap: wrap;
    gap: 10px;
    height: auto;
    padding: 12px 16px;
    background: #fff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .search {
    flex: 1 1 100%;
    max-width: none;
  }

  .search input {
    height: 40px;
    padding-right: 40px;
    font-size: 16px;
  }

  .search__kbd {
    display: none;
  }

  .topbar__right {
    width: 100%;
    gap: 8px;
  }

  .topbar__mgr {
    flex: 1;
    width: auto;
    min-width: 0;
  }

  .topbar__mgr .sel__prefix {
    display: none;
  }

  .topbar__add {
    padding: 0 13px;
  }

  .page {
    padding: 18px 16px 28px;
  }

  h1 {
    font-size: 21px;
  }

  .page__sub {
    font-size: 13px;
  }

  .page__head {
    gap: 12px;
  }

  .sync {
    height: 30px;
    font-size: 12px;
  }

  .stats {
    gap: 10px;
    margin: 16px 0 18px;
  }

  .stat {
    padding: 12px 13px 12px;
    border-radius: 12px;
  }

  .stat__label {
    font-size: 12.5px;
  }

  .stat__icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
  }

  .stat__icon .ico {
    width: 15px;
    height: 15px;
  }

  .stat__value {
    margin-top: 6px;
    font-size: 22px;
  }

  .stat__sub {
    flex-wrap: wrap;
    font-size: 11.5px;
    line-height: 1.35;
    white-space: normal;
  }

  .spark {
    gap: 2px;
    height: 22px;
  }

  .spark i {
    width: 4px;
  }

  .toolbar__count {
    display: none;
  }

  .filter-chip {
    height: 36px;
  }

  .board {
    align-items: flex-start;
    gap: 10px;
    margin: 0 -16px;
    padding: 0 16px 10px;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 16px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .col {
    flex: 0 0 85vw;
    min-width: 0;
    scroll-snap-align: start;
  }

  .card__name {
    font-size: 14px;
  }

  .table-card {
    border-radius: 12px;
  }

  .drawer {
    width: 100%;
    box-shadow: none;
  }

  .dw-head {
    padding: 14px 10px 14px 16px;
  }

  .pav--lg {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    font-size: 16px;
  }

  .dw-id h2 {
    font-size: 17.5px;
  }

  .dw-body {
    padding: 16px 16px 28px;
  }

  .dw-foot {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }

  .dw-contacts {
    grid-template-columns: 1fr;
  }

  .kpis {
    grid-template-columns: 1fr 1fr;
  }

  .modal-root {
    align-items: stretch;
    padding: 0;
  }

  .modal {
    max-width: none;
    max-height: none;
    height: 100%;
    border-radius: 0;
  }

  .modal__head {
    padding: 16px 10px 4px 16px;
  }

  .modal__body {
    padding: 12px 16px 6px;
  }

  .modal__foot {
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  }

  .modal__foot .btn {
    flex: 1;
  }

  .grid2 {
    grid-template-columns: 1fr;
  }

  .input {
    font-size: 16px;
  }

  .toasts {
    bottom: 16px;
  }

  body.dw-open .toasts {
    bottom: calc(82px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 560px) {
  .mgr-opt__last {
    display: none;
  }
}

@media (max-width: 400px) {
  .dw-controls {
    grid-template-columns: 1fr;
  }

  .topbar__add-more {
    display: none;
  }

  .deal__fields {
    gap: 10px;
  }

  .mgr-opt {
    gap: 7px;
    padding: 8px;
    font-size: 12.5px;
  }
}

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

  .sync__dot::after {
    display: none;
  }
}
