/* ТОПТРИ · ЛК геомаркетолога — оформление (бренд: navy #000D37 + градиент #FF008D→#FFCA00) */
:root {
  --navy: #000d37;
  --navy-2: #0a1a4a;
  --pink: #ff008d;
  --orange: #ff6a00;
  --yellow: #ffca00;
  --grad: linear-gradient(120deg, #ff008d 0%, #ff6a00 55%, #ffca00 100%);
  --bg: #f3f5fb;
  --card: #ffffff;
  --line: #e7eaf3;
  --ink: #16204a;
  --muted: #7a86ab;
  --ok: #17b26a;
  --shadow: 0 6px 24px rgba(16, 26, 74, 0.08);
  --shadow-2: 0 12px 40px rgba(16, 26, 74, 0.16);
  --r: 16px;
  --r-sm: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--pink); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- шапка ---------- */
.top {
  background: var(--navy);
  color: #fff;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky; top: 0; z-index: 20;
}
.top .logo { display: flex; align-items: center; gap: 10px; }
.top .logo svg { width: 34px; height: 34px; display: block; }
.top .logo .wm { font-weight: 800; letter-spacing: 2px; font-size: 20px; }
.top .logo .wm b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.top .sub { color: #aab3d6; font-size: 12px; margin-left: 2px; }
.top .sub .accent { color: var(--yellow); }
.top .spacer { flex: 1; }
.top .mode {
  font-size: 11px; color: #cdd4ee; border: 1px solid rgba(255,255,255,.18);
  padding: 3px 9px; border-radius: 20px;
}
.top .me { font-size: 12px; color: #cdd4ee; }

/* ---------- контейнер ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 20px 22px 60px; }
.page-tab .wrap { padding: 16px; max-width: none; }

/* ---------- статистика ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .v { font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.stat .v.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .l { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---------- панель инструментов ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .search { position: relative; flex: 1; min-width: 220px; }
.toolbar .search input {
  width: 100%; padding: 11px 14px 11px 38px; border: 1px solid var(--line);
  border-radius: 30px; background: #fff; font-size: 14px; outline: none;
}
.toolbar .search input:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255,0,141,.12); }
.toolbar .search::before { content: '🔍'; position: absolute; left: 13px; top: 50%; transform: translateY(-50%); opacity: .5; font-size: 13px; }
.select {
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 30px; background: #fff;
  font-size: 13px; color: var(--ink); outline: none; cursor: pointer;
}
.btn {
  border: none; border-radius: 30px; padding: 11px 18px; font-weight: 700; font-size: 14px;
  background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(255,0,141,.28);
  transition: transform .08s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(255,0,141,.34); }
.btn.ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--pink); color: var(--pink); }
.btn.sm { padding: 8px 14px; font-size: 13px; }

/* ---------- сетка проектов ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.proj {
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 16px; cursor: pointer; border: 1px solid transparent;
  transition: box-shadow .2s ease, transform .08s ease, border-color .2s ease;
  display: flex; flex-direction: column; gap: 12px;
}
.proj:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); border-color: #ffd0e8; }
.proj-top { display: flex; align-items: center; gap: 12px; }
.ring { --p: 0; --c: var(--pink); position: relative; width: 52px; height: 52px; flex: none; }
.ring svg { transform: rotate(-90deg); width: 52px; height: 52px; }
.ring .t { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.proj-title { font-weight: 700; font-size: 15px; line-height: 1.25; }
.proj-resp { color: var(--muted); font-size: 12px; margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.ava { width: 18px; height: 18px; border-radius: 50%; background: var(--grad); color: #fff; font-size: 9px; font-weight: 700; display: inline-grid; place-items: center; overflow: hidden; }
.ava img { width: 100%; height: 100%; object-fit: cover; }
.proj-cls { display: flex; flex-direction: column; gap: 8px; }
.mini { display: grid; grid-template-columns: 20px 1fr auto; gap: 8px; align-items: center; font-size: 12px; }
.mini .m-ico { text-align: center; }
.mini .m-name { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .m-pct { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.mbar { grid-column: 2 / 4; height: 6px; border-radius: 6px; background: #eef1f8; overflow: hidden; }
.mbar > i { display: block; height: 100%; background: var(--grad); border-radius: 6px; }
.proj-foot { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); padding-top: 10px; }

.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.empty .big { font-size: 40px; margin-bottom: 10px; }
.loading { text-align: center; color: var(--muted); padding: 50px; }

/* ---------- чек-листы (компонент) ---------- */
.cl-root { display: flex; flex-direction: column; gap: 14px; }
.cl-loading, .cl-error { padding: 30px; color: var(--muted); text-align: center; }
.cl-error { color: #c0392b; }
.cl-card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.cl-head { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; cursor: pointer; user-select: none; }
.cl-ico { font-size: 22px; line-height: 1.2; flex: none; }
.cl-head-main { flex: 1; min-width: 0; }
.cl-title-row { display: flex; align-items: center; gap: 10px; }
.cl-title { font-weight: 700; font-size: 15px; }
.cl-pill { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--navy); background: #f0f2fa; border-radius: 20px; padding: 3px 10px; font-variant-numeric: tabular-nums; }
.cl-hint { color: var(--muted); font-size: 12px; margin: 3px 0 8px; }
.cl-bar { height: 8px; border-radius: 8px; background: #eef1f8; overflow: hidden; margin-top: 6px; }
.cl-bar-fill { display: block; height: 100%; background: var(--grad); border-radius: 8px; transition: width .25s ease; }
.cl-chev { color: var(--muted); transition: transform .2s ease; margin-top: 2px; }
.cl-card:not(.open) .cl-chev { transform: rotate(-90deg); }
.cl-card:not(.open) .cl-body { display: none; }
.cl-body { padding: 4px 18px 14px; }

.cl-section { border-top: 1px solid var(--line); padding: 12px 0 4px; }
.cl-section-h { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.cl-section-t { font-weight: 700; font-size: 13px; color: var(--navy); }
.cl-section-c { margin-left: auto; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.cl-info { font-size: 12px; border-radius: var(--r-sm); padding: 8px 12px; margin: 6px 0; line-height: 1.4; }
.cl-info.tip { background: #eef7ff; color: #1f5c8b; border: 1px solid #d6ebff; }
.cl-info.warn { background: #fff6e6; color: #8a5b00; border: 1px solid #ffe6b3; }
.cl-info.crit { background: #ffeef5; color: #a1145e; border: 1px solid #ffd0e5; }

.cl-item-box { border-radius: var(--r-sm); }
.cl-item { display: flex; gap: 10px; align-items: flex-start; padding: 7px 8px; border-radius: var(--r-sm); }
.cl-item:hover { background: #f7f8fc; }
.cl-item.sub { padding-left: 26px; }
.cl-item.done .cl-txt { color: var(--muted); text-decoration: line-through; text-decoration-color: #cdd4ea; }
.cl-lab { display: flex; gap: 10px; align-items: flex-start; flex: 1; cursor: pointer; }
.cl-cb { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; border: 2px solid #c7cee3; border-radius: 6px; flex: none; margin-top: 1px; position: relative; cursor: pointer; transition: all .15s ease; }
.cl-cb:hover { border-color: var(--pink); }
.cl-cb:checked { background: var(--grad); border-color: transparent; }
.cl-cb:checked::after { content: ''; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.cl-txt { font-size: 13.5px; }
.cl-item-right { display: flex; align-items: center; gap: 8px; flex: none; }
.cl-meta { font-size: 11px; color: var(--muted); white-space: nowrap; }
.cl-note-btn { border: none; background: transparent; font-size: 14px; opacity: .35; border-radius: 6px; padding: 2px 4px; }
.cl-note-btn:hover { opacity: .9; background: #eef1f8; }
.cl-note-btn.has { opacity: .95; }
.cl-note { display: none; padding: 0 8px 8px 38px; }
.cl-note.open { display: block; }
.cl-note-input { width: 100%; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; font-family: inherit; font-size: 13px; resize: vertical; outline: none; }
.cl-note-input:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255,0,141,.1); }

/* ---------- шапка компании (вкладка/модалка) ---------- */
.co-head { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 14px; display: flex; align-items: center; gap: 16px; }
.co-head .ring { width: 60px; height: 60px; }
.co-head .ring svg { width: 60px; height: 60px; }
.co-name { font-weight: 800; font-size: 18px; }
.co-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.co-head .link { margin-left: auto; }

/* ---------- модалка ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(6, 12, 40, .55); backdrop-filter: blur(2px); display: none; z-index: 40; }
.modal-back.show { display: block; }
.modal { position: fixed; z-index: 41; top: 4vh; left: 50%; transform: translateX(-50%); width: min(760px, 94vw); max-height: 92vh; background: var(--bg); border-radius: 20px; box-shadow: var(--shadow-2); display: none; flex-direction: column; overflow: hidden; }
.modal.show { display: flex; }
.modal-h { background: var(--navy); color: #fff; padding: 16px 20px; display: flex; align-items: center; gap: 14px; }
.modal-h .ring svg circle:first-child { stroke: rgba(255,255,255,.2); }
.modal-h .m-title { font-weight: 800; font-size: 16px; }
.modal-h .m-sub { color: #aab3d6; font-size: 12px; }
.modal-h .x { margin-left: auto; background: rgba(255,255,255,.12); border: none; color: #fff; width: 34px; height: 34px; border-radius: 50%; font-size: 18px; }
.modal-h .x:hover { background: rgba(255,255,255,.24); }
.modal-body { padding: 16px 18px; overflow: auto; }

/* ---------- тост ---------- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 30px; box-shadow: var(--shadow-2); opacity: 0; transition: all .25s ease; z-index: 60; font-size: 13px; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #c0392b; }

/* ---------- адаптив ---------- */
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: 1fr; }
  .top .sub { display: none; }
}
