/* ===== nomadcar.kg — брендовая палитра и оформление доски ===== */

:root {
  /* Бренд */
  --brand-900: #0b3d3a;
  --brand-700: #0f766e; /* тёмная бирюза/изумруд — основа */
  --brand-500: #14b8a6;
  --brand-050: #ecfdf5;

  /* Тёплый акцент */
  --accent-600: #ea580c; /* терракота/охра — CTA */
  --accent-500: #f97316;

  /* Нейтральные */
  --bg: #eef2f5;
  --surface: #ffffff;
  --ink-900: #0f172a;
  --ink-600: #475569;
  --ink-400: #94a3b8;
  --line: #e2e8f0;

  /* Колонки */
  --col-new: #2563eb;    /* синий   */
  --col-work: #d97706;   /* янтарный */
  --col-success: #16a34a;/* зелёный */
  --col-reject: #dc2626; /* красный */

  --radius: 16px;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, .06), 0 6px 16px -8px rgba(15, 23, 42, .18);
  --shadow-lift: 0 12px 28px -10px rgba(15, 23, 42, .35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink-900);
  background:
    radial-gradient(1200px 600px at 12% -10%, #e6f7f4 0%, transparent 55%),
    radial-gradient(1000px 500px at 100% 0%, #fff3ea 0%, transparent 45%),
    var(--bg);
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* ===== Шапка ===== */
.app-header {
  background: linear-gradient(120deg, var(--brand-900) 0%, var(--brand-700) 55%, #0e6b74 100%);
  color: #fff;
  box-shadow: 0 10px 30px -18px rgba(15, 118, 110, .9);
}
.app-header__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand__logo {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .22);
  color: #fff;
  backdrop-filter: blur(4px);
}
.brand__text h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.05;
}
.brand__text h1 span { color: var(--accent-500); }
.brand__text p {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, .72);
}

/* Кнопка синхронизации */
.sync-btn {
  background: var(--accent-600);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 11px 18px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 8px 20px -10px rgba(234, 88, 12, .9);
  transition: background .16s ease, transform .16s ease, opacity .16s ease;
}
.sync-btn:hover { background: var(--accent-500); transform: translateY(-1px); }
.sync-btn:active { transform: translateY(0); }
.sync-btn:disabled { opacity: .6; cursor: default; transform: none; }

.sync-wrap { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.sync-meta { font-size: 11px; color: rgba(255, 255, 255, .72); text-align: center; }
.sync-meta b { color: #fff; font-weight: 600; }

/* Тост-уведомление */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  background: #0f172a;
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 28px -10px rgba(0, 0, 0, .5);
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 10000;
}
.toast--in { opacity: 1; transform: translate(-50%, 0); }

/* Сводка */
.stats { display: flex; gap: 12px; flex-wrap: wrap; }
.stat {
  min-width: 96px;
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .16);
  text-align: center;
}
.stat--accent {
  background: rgba(234, 88, 12, .18);
  border-color: rgba(249, 115, 22, .45);
}
.stat__value { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.stat__label { display: block; font-size: 11px; font-weight: 500; color: rgba(255, 255, 255, .7); margin-top: 2px; }

/* ===== Доска ===== */
.board {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 28px;
  display: grid;
  grid-template-columns: repeat(4, minmax(280px, 1fr));
  gap: 20px;
  align-items: start;
}

.column {
  background: rgba(255, 255, 255, .55);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
  backdrop-filter: blur(2px);
}
.column__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.column__dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.column__title { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.column__count {
  margin-left: auto;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-600);
  background: #fff;
  border: 1px solid var(--line);
}

/* Цветные акценты колонок (data-col) */
.column[data-col="new"]     { border-top: 3px solid var(--col-new); }
.column[data-col="in_work"] { border-top: 3px solid var(--col-work); }
.column[data-col="success"] { border-top: 3px solid var(--col-success); }
.column[data-col="rejected"]{ border-top: 3px solid var(--col-reject); }
.column[data-col="new"]     .column__dot { background: var(--col-new); }
.column[data-col="in_work"] .column__dot { background: var(--col-work); }
.column[data-col="success"] .column__dot { background: var(--col-success); }
.column[data-col="rejected"].column__dot,
.column[data-col="rejected"] .column__dot { background: var(--col-reject); }

.column__list {
  list-style: none;
  margin: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  min-height: 80px;
  flex: 1;
}
.column__list:empty::after {
  content: "Перетащите карточку сюда";
  display: block;
  text-align: center;
  color: var(--ink-400);
  font-size: 12.5px;
  padding: 22px 8px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
}

/* Тонкие скроллбары */
.column__list::-webkit-scrollbar { width: 8px; }
.column__list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
.column__list::-webkit-scrollbar-track { background: transparent; }

/* ===== Карточка ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow-card);
  cursor: grab;
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
  position: relative;
  -webkit-user-select: none;
  user-select: none;
}
/* ссылку внутри карточки оставляем кликабельной/выделяемой */
.card__fb { -webkit-user-select: none; user-select: none; }
.card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); border-color: #cbd5e1; }
.card:active { cursor: grabbing; }

.card__top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.card__avatar {
  width: 38px; height: 38px; flex: none;
  border-radius: 11px;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 13px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}
.card__who { min-width: 0; }
.card__author { font-size: 13.5px; font-weight: 700; line-height: 1.2; }
.card__meta { font-size: 11.5px; color: var(--ink-400); display: flex; align-items: center; gap: 5px; }

.card__badge {
  position: absolute; top: 12px; right: 12px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-400);
  background: #f1f5f9;
  border: 1px solid var(--line);
  padding: 2px 6px; border-radius: 6px;
}

.card__text {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-900);
  margin: 0 0 12px;
}

.card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag {
  font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
  color: var(--brand-700);
  background: var(--brand-050);
  border: 1px solid #cdece6;
}

.card__fb {
  display: inline-flex; align-items: center; gap: 8px;
  width: 100%;
  justify-content: center;
  font-size: 12.5px; font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: #1877f2;
  padding: 9px 12px;
  border-radius: 10px;
  transition: background .16s ease, transform .16s ease;
}
.card__fb:hover { background: #0f66d6; transform: translateY(-1px); }
.card__fb svg { flex: none; }

/* ===== Состояния перетаскивания (SortableJS) ===== */
.card.drag-ghost {
  opacity: .35;
  background: var(--brand-050);
  border: 1.5px dashed var(--brand-500);
  box-shadow: none;
}
.card.drag-chosen { box-shadow: var(--shadow-lift); }
.card.drag-active { transform: rotate(1.5deg) scale(1.02); box-shadow: var(--shadow-lift); }
.column__list.drop-hover { background: rgba(20, 184, 166, .06); border-radius: 12px; }

/* Появление карточек */
@keyframes pop-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.card { animation: pop-in .28s ease both; }

/* Карточки в «Новые лиды» кликабельны — клик берёт лид в работу */
.column[data-col="new"] .card { cursor: pointer; }

/* Подсказка на карточке «Новые лиды» */
.card__hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-600);
  opacity: .9;
  transition: opacity .16s ease;
}
.column[data-col="new"] .card:hover .card__hint { opacity: 1; }
.card__hint svg { flex: none; }

/* Пульс при переносе кликом */
@keyframes moved-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(217, 119, 6, .55); }
  100% { box-shadow: 0 0 0 14px rgba(217, 119, 6, 0); }
}
.card--moved { animation: pop-in .28s ease both, moved-pulse .65s ease-out; }

/* ===== Подвал ===== */
.app-footer {
  text-align: center;
  color: var(--ink-400);
  font-size: 12px;
  padding: 8px 16px 22px;
}

/* Адаптив: колонки в 2 ряда на узких экранах */
@media (max-width: 1080px) {
  .board { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
  .column { max-height: none; }
}
@media (max-width: 620px) {
  .board { grid-template-columns: 1fr; padding: 18px; }
  .app-header__inner { padding: 16px; }
  .stat { min-width: 78px; padding: 8px 12px; }
}
