@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 400; src: url(/fonts/inter-latin-400-normal.woff2) format('woff2');  }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 400; src: url(/fonts/inter-cyrillic-400-normal.woff2) format('woff2');  }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 600; src: url(/fonts/inter-latin-600-normal.woff2) format('woff2');  }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 600; src: url(/fonts/inter-cyrillic-600-normal.woff2) format('woff2');  }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 700; src: url(/fonts/inter-latin-700-normal.woff2) format('woff2');  }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 700; src: url(/fonts/inter-cyrillic-700-normal.woff2) format('woff2');  }
:root {
  /* MindTech brand tokens (tokens.json v1). Content = light theme, chrome = dark (ink). */
  --bg: #f5f7f9;            /* surface (light) */
  --surface: #ffffff;       /* surface-raised */
  --tile: #eef2f5;
  --border: rgba(11, 17, 23, 0.10);   /* line */
  --border-strong: rgba(11, 17, 23, 0.28);
  --text: #0b1117;
  --muted: #536a7d;         /* text-subtle */
  --muted-strong: #3f5466;  /* text-muted */
  --accent: #1f5bff;        /* MindTech Blue */
  --accent-hover: #174ad6;
  --accent-ink: #ffffff;
  --accent-soft: rgba(31, 91, 255, 0.08);
  --ink: #0b1117;
  --ink-raised: #15202a;
  --ink-tile: #1b2834;
  --ink-line: rgba(184, 208, 222, 0.14);
  --ink-text: #f0f5f7;
  --ink-muted: #b8d0de;
  --neon: #2dff7a;          /* Neon Pixel: dark backgrounds only, <5% area, never a button fill */
  --danger: #c4321f;
  --danger-dark: #ff7a66;
  --ok: #0f7a52;
  --warn: #b54708;
  --radius: 12px;
  --radius-sm: 6px;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { padding: 40px; color: var(--muted); text-align: center; }

/* login */
body.dark { background: var(--ink); }
.login { max-width: 380px; margin: 12vh auto; padding: 32px 24px; background: var(--ink-raised); border: 1px solid var(--ink-line); border-radius: var(--radius); color: var(--ink-text); }
.login .logo { height: 28px; display: block; margin-bottom: 24px; }
.login .logo .px { color: var(--neon); }
.login label { color: var(--ink-muted); }
.login input { background: var(--ink-tile); border-color: rgba(184, 208, 222, 0.32); color: var(--ink-text); }
.login .err { color: var(--danger-dark); }
.login .btn.link { color: #8fb0ff; }
.login h1 { margin: 0 0 4px; font-size: 22px; }
.login p { margin: 0 0 24px; color: var(--ink-muted); }

/* layout */
header { display: flex; align-items: center; gap: 16px; padding: 10px 24px; background: var(--ink); color: var(--ink-text); position: sticky; top: 0; z-index: 5; }
header .brand { display: flex; align-items: center; gap: 10px; }
header .brand img { height: 22px; display: block; }
header .brand .tag { font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--ink-muted); border-left: 1px solid var(--ink-line); padding-left: 10px; }
.live { width: 8px; height: 8px; border-radius: 2px; background: var(--neon); display: inline-block; box-shadow: 0 0 8px rgba(45, 255, 122, .6); }
header nav { display: flex; gap: 4px; }
header nav button { background: none; border: 0; padding: 8px 14px; border-radius: 999px; cursor: pointer; color: var(--ink-muted); }
header nav button.active { background: var(--ink-tile); color: var(--ink-text); font-weight: 600; }
header .me { margin-left: auto; color: var(--ink-muted); font-size: 14px; display: flex; gap: 12px; align-items: center; }
header .me a, header .me .btn.link { color: #8fb0ff; }
main { max-width: 1200px; margin: 0 auto; padding: 24px; }

/* form controls */
label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 4px; }
.field { margin-bottom: 16px; }
input, select, textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
textarea { min-height: 80px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 14px; }
.check input { width: auto; }
.btn { padding: 9px 18px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-weight: 600; transition: background-color .15s cubic-bezier(.2,0,0,1); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.link { border: 0; background: none; color: var(--accent); padding: 0; font-weight: 500; }
.err { color: var(--danger); font-size: 14px; margin: 8px 0 0; min-height: 1em; }
.hint { color: var(--muted); font-size: 13px; }

/* summary */
.stats { display: flex; gap: 1px; flex-wrap: wrap; margin-bottom: 16px; background: var(--ink-line); border-radius: var(--radius); overflow: hidden; width: fit-content; max-width: 100%; }
.stat { background: var(--ink); border: 0; padding: 12px 18px; min-width: 130px; cursor: pointer; text-align: left; color: var(--ink-text); }
.stat:hover { background: var(--ink-raised); }
.stat b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.stat.key b { color: var(--neon); }
.stat span { color: var(--ink-muted); font-size: 12px; }
.stat.active { background: var(--ink-tile); box-shadow: inset 0 -3px 0 var(--accent); }

/* filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters input[type=search] { flex: 1 1 220px; width: auto; }
.filters .check { margin: 0; white-space: nowrap; }
.filters select { width: auto; flex: 0 1 200px; }

/* table */
.tablewrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--tile); }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--accent-soft); }
td.wrap { white-space: normal; min-width: 180px; }
.sub { color: var(--muted); font-size: 12px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; background: #eef2f6; }
.pill.s-new { background: var(--ink); color: var(--neon); font-weight: 600; }
.pill.s-unassigned { background: #fff1e6; color: var(--warn); }
.pill.s-won { background: #e7f6ec; color: var(--ok); }
.pill.s-lost { background: #f2f4f7; color: var(--muted); }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* panel */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; max-width: 760px; }
.overlay { position: fixed; inset: 0; background: rgba(16, 24, 40, .35); z-index: 10; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); z-index: 11; overflow-y: auto; padding: 20px 24px 40px; box-shadow: -4px 0 24px rgba(16, 24, 40, .12); }
.drawer h2 { margin: 0 0 4px; font-size: 18px; }
.drawer .top { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 16px; }
.section { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 8px; }
.section h3 { font-size: 14px; margin: 0 0 12px; }
.suggest { background: #f3f6ff; border-radius: 6px; padding: 8px 10px; font-size: 13px; margin-bottom: 8px; }
.hist { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.hist li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.row { display: flex; gap: 8px; align-items: end; }
.row > .field { flex: 1; margin-bottom: 0; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1b1f24; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 20; }
#toast.show { opacity: 1; }

@media (max-width: 720px) {
  header { flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
  header .me { margin-left: 0; width: 100%; justify-content: space-between; }
  main { padding: 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .stats { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .stat { flex: 0 0 auto; }
  .card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }
.full { width: 100%; }
.mt0 { margin-top: 0; }

/* v2: quick stats, cards, stepper */
.stat.alert b { color: var(--danger-dark); }
.late { color: var(--danger); font-size: 13px; }
.only-sm { display: none; }
.cards { list-style: none; margin: 0; padding: 0; gap: 8px; }
.lcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; }
.lc-top { display: flex; justify-content: space-between; gap: 8px; align-items: start; margin-bottom: 2px; }
.lc-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 8px; }
.btn.sm { padding: 6px 10px; font-size: 13px; text-decoration: none; display: inline-block; }
a.btn { text-decoration: none; color: inherit; }
.fab { position: fixed; right: 16px; bottom: 20px; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-size: 28px; line-height: 1; box-shadow: 0 4px 12px rgba(16, 24, 40, .2); cursor: pointer; z-index: 6; }
.steps { list-style: none; display: flex; gap: 4px; padding: 0; margin: 0 0 12px; }
.steps li { flex: 1; height: 6px; border-radius: 3px; background: var(--border); position: relative; }
.steps li.done { background: #9db7ff; }
.steps li.cur { background: var(--accent); }
.steps li span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.steps li.cur span { position: static; width: auto; height: auto; clip: auto; display: block; margin-top: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.steps:has(li.cur) { margin-bottom: 28px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.need { background: var(--bg); border-radius: 6px; padding: 10px 12px; margin: 8px 0; font-size: 14px; white-space: pre-wrap; }
details.more { margin: 4px 0 16px; }
details.more summary { cursor: pointer; color: var(--accent); font-weight: 500; margin-bottom: 12px; }
@media (max-width: 720px) {
  .only-sm { display: block; }
  .cards.only-sm { display: grid; }
  .only-lg { display: none; }
  .stats { flex-wrap: wrap; overflow: visible; }
  .stats { width: 100%; }
  .stat { flex: 1 1 40%; min-width: 0; }
  .filters select, .filters input[type=search] { flex: 1 1 100%; width: 100%; min-width: 0; }
  main { padding-bottom: 96px; }
}
