/* Веб-кабинет «Задачи вашей команды» — в стиле avetdigital.ru:
   заголовки Montserrat 900, текст JetBrains Mono, основной #107FCE, скругления 25px, мягкие тени. */
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/montserrat-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/montserrat-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("fonts/jetbrainsmono-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("fonts/jetbrainsmono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --primary: #107FCE; --primary-dark: #005EBF; --primary-soft: rgba(16,127,206,.08);
  --text: #1C1C1C; --muted: #54595F; --line: #E4E4E4; --bg: #F4F7FB; --card: #FFFFFF;
  --late: #E5484D; --late-soft: #FDECEC; --ok: #1E9E5A; --ok-soft: #E3F7EA;
  --radius: 25px; --shadow: 0 0 10px rgba(0,0,0,.08); --shadow-hover: 2px 8px 23px 3px rgba(0,0,0,.12);
  --head: "Montserrat", Arial, sans-serif; --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--mono); }
a { color: var(--primary); }
h1, h2, h3 { font-family: var(--head); font-weight: 900; letter-spacing: -.01em; color: var(--text); }
h1 { font-size: clamp(28px, 4.4vw, 44px); line-height: 1.1; margin: 0 0 10px; }
h2 { font-size: clamp(20px, 2.6vw, 26px); margin: 44px 0 14px; }
h3 { font-size: 15px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--late); font-weight: 700; }

/* --- шапка --- */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px clamp(16px, 4vw, 48px); background: var(--card); box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none;
  font: 900 18px/1 var(--head); }
.brand img { border-radius: 12px; }
.user { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.user a { color: var(--text); text-decoration: none; font-weight: 600; }
.user a:hover { color: var(--primary); }
.user .name { color: var(--muted); }
.user form { margin: 0; }
button.ghost, button.link { background: none; border: 1.5px solid var(--primary); color: var(--primary);
  border-radius: var(--radius); padding: 6px 16px; font: 600 13px var(--mono); cursor: pointer; }
button.ghost:hover, button.link:hover { background: var(--primary); color: #fff; }

main { max-width: 1160px; margin: 0 auto; padding: clamp(24px, 5vw, 56px) clamp(16px, 4vw, 48px); }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 36px 16px; }
.flash { background: var(--ok-soft); color: var(--ok); border-radius: var(--radius); padding: 10px 20px; font-weight: 600;
  display: inline-block; }
.crumbs { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.crumbs a { text-decoration: none; }

/* --- вход --- */
.login { max-width: 560px; margin: 8vh auto; background: var(--card); border-radius: var(--radius); padding: 48px 40px;
  box-shadow: var(--shadow-hover); text-align: center; }
.login h1 { font-size: clamp(28px, 4vw, 38px); }

/* --- показатели и карточки --- */
.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin: 24px 0 8px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.stat b { display: block; font: 900 40px/1 var(--head); color: var(--primary); }
.stat span { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; }
.stat.late b { color: var(--late); } .stat.ok b { color: var(--ok); }
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card { background: var(--card); border-radius: var(--radius); padding: 22px 24px; display: flex; flex-direction: column;
  gap: 6px; box-shadow: var(--shadow); border-top: 4px solid var(--primary); }
.card b { font: 900 17px/1.3 var(--head); }
a.card { text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.badge { align-self: flex-start; border-radius: var(--radius); padding: 2px 12px; font-size: 12px; font-weight: 700; }
.badge.late { background: var(--late-soft); color: var(--late); }

/* --- таблицы --- */
.table-wrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: 16px 16px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th a.sort { color: var(--muted); text-decoration: none; }
th a.sort:hover, th a.sort.on { color: var(--primary); }
th a.sort .arrow { font-size: 10px; margin-left: 4px; }
td { padding: 14px 16px; border-bottom: 1px solid #F0F1F3; vertical-align: middle; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--primary-soft); }
tr:last-child td { border-bottom: 0; }
tr.is-late td:first-child { box-shadow: inset 4px 0 0 var(--late); }
td.num { color: var(--muted); white-space: nowrap; }
td.nowrap { white-space: nowrap; }
td a { color: var(--text); font-weight: 600; text-decoration: none; }
td a:hover { color: var(--primary); }
.empty { padding: 20px 4px; }
.prio, .status { display: inline-block; border-radius: var(--radius); padding: 3px 12px; font-size: 12px; font-weight: 700;
  white-space: nowrap; }
.prio.p1 { background: var(--late-soft); color: #B42318; } .prio.p2 { background: #FFF4D6; color: #8A6100; }
.prio.p3 { background: var(--ok-soft); color: var(--ok); }
.status.s-new { background: #EEF1F5; color: var(--text); } .status.s-in_progress { background: var(--primary-soft); color: var(--primary); }
.status.s-done { background: var(--ok-soft); color: var(--ok); } .status.s-cancelled { background: #F1F1F1; color: var(--muted); }
.late { color: var(--late); font-weight: 700; }

/* --- кнопки, фильтры, формы --- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; align-items: center; }
.btn { display: inline-block; background: var(--primary); color: #fff; border: 0; border-radius: var(--radius);
  padding: 12px 26px; font: 700 14px var(--mono); text-decoration: none; cursor: pointer; transition: background .15s; }
.btn:hover { background: var(--primary-dark); }
.btn.ghost-dark { background: var(--card); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost-dark:hover { box-shadow: inset 0 0 0 1.5px var(--primary); color: var(--primary); }
.btn.danger { background: var(--late); } .btn.danger:hover { background: #C53035; }
.chip { border-radius: var(--radius); padding: 8px 18px; text-decoration: none; color: var(--text); font-weight: 600;
  font-size: 13px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); }
.chip.active { background: var(--primary); color: #fff; box-shadow: none; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 16px; }
select, input[type=search], input[type=date], textarea { font: 14px var(--mono); border: 1.5px solid var(--line);
  border-radius: var(--radius); padding: 10px 16px; background: var(--card); color: var(--text); }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--primary); }
.filters button { font: 700 14px var(--mono); border: 0; border-radius: var(--radius); padding: 10px 22px;
  background: var(--text); color: #fff; cursor: pointer; }
.task-form { background: var(--card); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 18px; max-width: 900px; }
.task-form label { display: flex; flex-direction: column; gap: 8px; font: 700 12px var(--mono); text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); }
.task-form .row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.task-form textarea { resize: vertical; min-height: 90px; border-radius: 18px; font-size: 15px; text-transform: none;
  letter-spacing: 0; color: var(--text); }
.task-form .btn { align-self: flex-start; }
.task-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 10px 0 20px; font-size: 13px; }
.readonly { background: var(--card); border-radius: var(--radius); padding: 22px; font-size: 17px; font-weight: 600;
  box-shadow: var(--shadow); }
.danger-zone { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 18px; max-width: 900px; }
.danger-zone .check { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.history { list-style: none; padding: 0; margin: 0; font-size: 13px; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); }
.history li { padding: 12px 22px; border-bottom: 1px solid #F0F1F3; }
.history li:last-child { border-bottom: 0; }

/* --- графики (внизу страницы) --- */
.charts { margin-top: 56px; border-top: 1px solid var(--line); padding-top: 8px; }
.chart-box { background: var(--card); border-radius: var(--radius); padding: 24px; margin: 16px 0; box-shadow: var(--shadow); }
svg.chart { width: 100%; height: auto; display: block; }
svg.chart .axis { stroke: var(--line); }
svg.chart text { font-family: var(--mono); fill: var(--muted); font-size: 11px; }
svg.chart .val { text-anchor: middle; fill: var(--text); font-weight: 700; }
svg.chart .lbl { text-anchor: middle; }
svg.chart .lbl-left { font-size: 12px; fill: var(--text); font-weight: 600; }
svg.chart .val-left { font-size: 12px; fill: var(--text); font-weight: 700; }
.c-created { fill: var(--primary); color: var(--primary); } .c-done { fill: #34C759; color: #34C759; }
.bar-p1 { fill: #FF5A5F; } .bar-p2 { fill: #FFC233; } .bar-p3 { fill: #34C759; }
.bar-late { fill: var(--late); } .bar-done { fill: #34C759; }
.legend { font-size: 12px; color: var(--muted); margin: 8px 0 0; }

@media (max-width: 680px) {
  .top { flex-wrap: wrap; } .user .name { display: none; }
  th:nth-child(4), td:nth-child(4) { display: none; }
  .stat b { font-size: 32px; }
}
