/* TaskTracker — минималистичная система (без внешних CDN) */
:root {
  --bg: #f5f6f8; --card: #ffffff; --ink: #1e2430; --muted: #6b7280;
  --line: #e5e7eb; --accent: #2563eb; --accent-ink: #ffffff;
  --ok: #16a34a; --warn: #d97706; --bad: #dc2626;
  --radius: 10px; --shadow: 0 1px 3px rgba(16,24,40,.08);
  font-size: 15px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Навигация */
.topbar {
  background: #111827; color: #fff; display: flex; align-items: center;
  gap: 1rem; padding: .6rem 1rem; position: sticky; top: 0; z-index: 10;
}
.topbar .brand { font-weight: 700; font-size: 1.05rem; color: #fff; letter-spacing: .3px; }
.topbar nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.topbar nav a { color: #cbd5e1; padding: .35rem .7rem; border-radius: 8px; font-size: .92rem; }
.topbar nav a:hover, .topbar nav a.active { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.topbar .spacer { flex: 1; }
.btn-new {
  background: var(--accent); color: #fff; padding: .4rem .9rem; border-radius: 8px;
  font-size: .9rem; font-weight: 600; border: none;
}
.btn-new:hover { background: #1d4ed8; text-decoration: none; }

main { max-width: 1100px; margin: 0 auto; padding: 1rem; }

/* Карточки и сетки */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: 2fr 1fr; }
h1 { font-size: 1.45rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Формы */
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .6rem; }
input, select, textarea {
  width: 100%; padding: .5rem .6rem; margin-top: .2rem; font: inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #bfdbfe; border-color: var(--accent); }
.form-row { display: flex; gap: .8rem; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 140px; }
.btn {
  display: inline-block; border: none; border-radius: 8px; padding: .45rem .9rem;
  font: inherit; font-weight: 600; cursor: pointer; background: #e5e7eb; color: var(--ink);
}
.btn:hover { filter: brightness(.96); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-sm { padding: .25rem .6rem; font-size: .85rem; }

/* Таблицы */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; }
th, td { padding: .5rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:hover td { background: #f8fafc; }

/* Бейджи */
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.b-gray   { background: #e5e7eb; color: #374151; }
.b-blue   { background: #dbeafe; color: #1d4ed8; }
.b-green  { background: #dcfce7; color: #15803d; }
.b-amber  { background: #fef3c7; color: #b45309; }
.b-red    { background: #fee2e2; color: #b91c1c; }
.b-violet { background: #ede9fe; color: #6d28d9; }

/* Фильтры */
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: end; }
.filters > div { min-width: 130px; flex: 1; }
.filters input, .filters select { margin-top: 0; }

/* Пагинация */
.pager { display: flex; gap: .8rem; align-items: center; justify-content: center; margin: .8rem 0; }
.pager .cur { font-weight: 600; }

/* Комментарии */
.comment { border-left: 3px solid var(--line); padding-left: .7rem; margin-bottom: .7rem; }
.comment .meta { font-size: .78rem; color: var(--muted); }

/* Флоу статусов */
.flow { font-size: .85rem; }
.flow .step { display: inline-flex; align-items: center; gap: .3rem; margin: .15rem .2rem .15rem 0; }
.flow .arr { color: var(--muted); }
.flow .role { font-size: .72rem; color: var(--muted); }

/* Логин */
.login-bg { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 2rem; width: min(360px, 92vw); }
.login-card h1 { text-align: center; }
.btn-block { width: 100%; margin-top: .6rem; }

/* Уведомление */
.flash { background: #111827; color: #fff; border-radius: 8px; padding: .5rem .9rem; font-size: .9rem; margin-bottom: .8rem; }
.err-box { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; border-radius: 8px; padding: .5rem .8rem; margin-bottom: .8rem; font-size: .9rem; }

/* Мобильная адаптация */
@media (max-width: 760px) {
  .grid-2 { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  main { padding: .6rem; }
  table.resp thead { display: none; }
  table.resp tr { display: block; border: 1px solid var(--line); border-radius: 8px; margin-bottom: .5rem; padding: .4rem; background: var(--card); }
  table.resp td { display: flex; justify-content: space-between; gap: .8rem; border: none; padding: .2rem .1rem; }
  table.resp td::before { content: attr(data-l); color: var(--muted); font-size: .78rem; }
  .hide-m { display: none; }
}

/* Ревизия 2 */
.search-wrap { position: relative; min-width: 200px; }
.clear-x { position: absolute; top: 26px; right: 6px; border: none; background: #e5e7eb; border-radius: 50%; width: 18px; height: 18px; line-height: 1; font-size: 11px; cursor: pointer; color: #374151; }
.inline { display: flex; align-items: center; gap: .4rem; margin: 0; }
.inline input { width: auto; margin: 0; }
.filter-check { display: flex; align-items: center; padding-top: 1.05rem; }
.md p { margin: .3rem 0; }
.md table { margin: .4rem 0; }
.md code { background: #f1f5f9; padding: .1rem .3rem; border-radius: 4px; font-size: .85em; }
.md pre { background: #f1f5f9; padding: .6rem; border-radius: 8px; overflow-x: auto; }
.dep-line { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.dep-del { display: inline; margin-left: auto; }
.dep-del button { padding: 0 .4rem; }
.sug-wrap { position: relative; flex: 2; min-width: 160px; }
.sug-wrap input { margin-top: 0; }
.sug-drop { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); z-index: 20; display: none; max-height: 240px; overflow-y: auto; }
.sug-drop.up { top: auto; bottom: 100%; }
.sug-drop option { padding: .4rem .6rem; cursor: pointer; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sug-drop option:hover { background: #eff6ff; }
