/* UGC Fit Mentor — общий стиль. Креатор открывает с телефона, куратор — с ноутбука. */
:root {
  --bg: #f4f5f2;
  --card: #ffffff;
  --ink: #1b1f1d;
  --muted: #69716c;
  --line: #e3e6e1;
  --line-strong: #cfd4ce;
  --accent: #1f6f5c;
  --accent-ink: #ffffff;
  --accent-soft: #e3f1ec;
  --warn: #b45309;
  --warn-soft: #fdf1e1;
  --bad: #b42318;
  --bad-soft: #fde8e6;
  --info: #1d4ed8;
  --info-soft: #e6edfd;
  --ok: #157f3c;
  --ok-soft: #e3f4e8;
  --gray-soft: #eef0ed;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 2px 8px rgba(20, 30, 25, .04);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --pf-instagram: #c13584;
  --pf-tiktok: #111111;
  --pf-youtube: #e62117;
  --pf-vk: #0077ff;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; line-height: 1.2; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
p { margin: 0 0 10px; }
small, .muted { color: var(--muted); }
.num, td.n, th.n { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
code { font-family: var(--mono); font-size: 13px; background: var(--gray-soft); padding: 1px 5px; border-radius: 5px; }

/* --- каркас */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 18px;
  padding: 0 20px; height: 54px;
  background: var(--ink); color: #fff;
}
.brand { color: #fff; font-weight: 800; letter-spacing: .02em; font-size: 17px; white-space: nowrap; }
.brand span { color: #8fd3bf; font-weight: 600; margin-left: 4px; }
.brand:hover { text-decoration: none; }
.topbar nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav a {
  color: #c9d1cc; padding: 7px 11px; border-radius: 8px; white-space: nowrap; font-size: 14px; position: relative;
}
.topbar nav a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.topbar nav a.on { color: #fff; background: rgba(255,255,255,.14); }
.topbar nav .count {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px;
  background: #f59e0b; color: #1b1f1d; font-size: 11px; font-weight: 700; text-align: center; line-height: 18px;
}
.who { color: #aab3ad; font-size: 13px; white-space: nowrap; }
.who a { color: #fff; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 22px 20px 60px; }
.is-creator .wrap { max-width: 760px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; }
.stack > * + * { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2 { padding: 16px 18px 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card.flush .card-head { padding: 16px 18px 0; }

/* --- KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .label { color: var(--muted); font-size: 13px; }
.kpi .value { font-size: 24px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi .hint { color: var(--muted); font-size: 12px; margin-top: 2px; }
.kpi.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.kpi.accent .label, .kpi.accent .hint { color: #cfe9e0; }

/* --- оповещения куратора */
.alerts { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.alert-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--line); color: var(--ink); font-size: 14px;
}
.alert-chip b { font-variant-numeric: tabular-nums; }
.alert-chip.hot { background: var(--warn-soft); border-color: #f3d3a8; }
.alert-chip.bad { background: var(--bad-soft); border-color: #f5c2bd; }
.alert-chip:hover { text-decoration: none; border-color: var(--line-strong); }
.alert-chip.zero { opacity: .55; }

/* --- таблицы */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
     padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbf9; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafbf9; }
tr.dim td { color: var(--muted); }
tfoot td { font-weight: 700; background: #fafbf9; border-top: 1px solid var(--line-strong); }
.t-actions { white-space: nowrap; text-align: right; }

/* --- бейджи */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--gray-soft); color: var(--muted);
}
.badge.green { background: var(--ok-soft); color: var(--ok); }
.badge.teal { background: var(--accent-soft); color: var(--accent); }
.badge.blue { background: var(--info-soft); color: var(--info); }
.badge.amber { background: var(--warn-soft); color: var(--warn); }
.badge.red { background: var(--bad-soft); color: var(--bad); }
.badge.gray { background: var(--gray-soft); color: var(--muted); }
.badge.level { background: #1b1f1d; color: #fff; }

.pf { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; white-space: nowrap; }
.pf::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.pf-instagram { color: var(--pf-instagram); }
.pf-tiktok { color: var(--pf-tiktok); }
.pf-youtube { color: var(--pf-youtube); }
.pf-vk { color: var(--pf-vk); }
.pf b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.pf.err b { color: var(--bad); }
.pf.manual b { color: var(--warn); }
.pf-list { display: flex; flex-wrap: wrap; gap: 4px 12px; }

/* --- кнопки и формы */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 15px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: var(--card); color: var(--ink); font: 600 14px/1.2 var(--font); cursor: pointer; white-space: nowrap;
}
.btn:hover { text-decoration: none; border-color: #b9c0b9; background: #fafbf9; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #185c4c; }
.btn.danger { color: var(--bad); border-color: #efc4bf; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.warn { color: var(--warn); border-color: #f1d2a8; }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 7px; }
.btn.big { padding: 14px 20px; font-size: 16px; border-radius: 11px; width: 100%; }
.btn.link { border: 0; background: none; color: var(--accent); padding: 0; font-weight: 500; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }

label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
label .opt { font-weight: 400; color: var(--muted); }
input[type=text], input[type=password], input[type=url], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 9px;
  font: 15px/1.3 var(--font); background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #9fd2c2; outline-offset: 0; border-color: var(--accent); }
textarea { min-height: 70px; resize: vertical; }
.field { margin-bottom: 14px; }
.field .help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 400; font-size: 14px; margin: 0 0 8px; cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters .field { margin: 0; min-width: 150px; }
.filters select, .filters input { padding: 8px 10px; font-size: 14px; }

.link-input { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; margin-bottom: 10px; }
.link-input .pf { font-weight: 600; }
@media (max-width: 520px) { .link-input { grid-template-columns: 1fr; gap: 4px; } }

/* --- сообщения */
.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; border: 1px solid; }
.flash.ok { background: var(--ok-soft); border-color: #bfe3c9; color: #0f5b2b; }
.flash.error { background: var(--bad-soft); border-color: #f5c2bd; color: #8a1c13; }
.flash.warn { background: var(--warn-soft); border-color: #f3d3a8; color: #7c3a06; }
.note { padding: 12px 14px; border-radius: 10px; background: var(--gray-soft); font-size: 14px; }
.note.warn { background: var(--warn-soft); }
.note.bad { background: var(--bad-soft); }
.note.ok { background: var(--accent-soft); }

/* --- креатор: лента роликов */
.today-cta { display: flex; align-items: center; gap: 16px; justify-content: space-between; flex-wrap: wrap; }
.today-cta .big { font-size: 18px; font-weight: 700; }
.vlist { list-style: none; margin: 0; padding: 0; }
.vitem { display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line); color: var(--ink); }
.vitem:last-child { border-bottom: 0; }
.vitem:hover { background: #fafbf9; text-decoration: none; }
.vdate { text-align: center; line-height: 1.1; }
.vdate b { display: block; font-size: 18px; }
.vdate small { font-size: 11px; text-transform: uppercase; }
.vmain .top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.vside { text-align: right; }
.vside .views { font-weight: 700; font-variant-numeric: tabular-nums; }
.vside .money { font-size: 13px; color: var(--accent); font-weight: 600; }

.progress { height: 8px; background: var(--gray-soft); border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

.rating-list { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.rating-list li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.rating-list li:last-child { border-bottom: 0; }
.rating-list li.mine { font-weight: 700; color: var(--accent); }
.place { display: inline-block; width: 22px; color: var(--muted); }

/* --- карточка ролика */
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 8px; } }
.snap { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.snap .total { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
details > summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14px; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸ "; }
details[open] > summary::before { content: "▾ "; }
details .inner { margin-top: 12px; }

/* --- сетка сдачи (куратор) */
.daygrid td.d { padding: 4px 2px; text-align: center; }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 4px; background: var(--gray-soft); vertical-align: middle; }
.dot.published, .dot.closed { background: #3aa47f; }
.dot.accepted { background: #8fd3bf; }
.dot.submitted, .dot.resubmitted { background: #7aa2f7; }
.dot.rework { background: #f59e0b; }
.dot.rejected { background: #e5534b; }
.daygrid th.d { padding: 6px 2px; text-align: center; font-size: 10px; text-transform: none; letter-spacing: 0; }
.daygrid th.d.we, .daygrid td.d.we { background: #f6f7f4; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }

/* --- проверка */
.review-card { display: grid; grid-template-columns: 1fr 340px; gap: 18px; }
@media (max-width: 900px) { .review-card { grid-template-columns: 1fr; } }
.thumb { max-width: 220px; max-height: 300px; border-radius: 8px; border: 1px solid var(--line); display: block; }

/* --- вход */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth .card { width: 100%; max-width: 380px; padding: 28px; }
.auth h1 { margin-bottom: 4px; }
.auth .brand-big { font-weight: 800; font-size: 22px; margin-bottom: 18px; }
.auth .brand-big span { color: var(--accent); font-weight: 600; }

.empty { padding: 28px; text-align: center; color: var(--muted); }
.mt { margin-top: 16px; }
.mb0 { margin-bottom: 0; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.break { word-break: break-all; }

@media (max-width: 640px) {
  .topbar { padding: 0 12px; gap: 10px; height: auto; min-height: 54px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 6px; }
  .topbar nav { order: 3; flex-basis: 100%; }
  .who { margin-left: auto; }
  .wrap { padding: 16px 12px 50px; }
  h1 { font-size: 21px; }
  .card { padding: 14px; }
  .kpi .value { font-size: 20px; }
  td, th { padding: 9px 10px; }
}

/* --- инструкции */
.help section { margin-top: 16px; scroll-margin-top: 70px; }
.help ol, .help ul { padding-left: 22px; margin: 0 0 10px; }
.help li { margin-bottom: 7px; }
.help li:last-child { margin-bottom: 0; }
.help .statuses, .help .links-ex { list-style: none; padding-left: 0; }
.help .statuses li, .help .links-ex li { margin-bottom: 9px; }
.help td { vertical-align: top; }
.help td.n { white-space: normal; text-align: left; }
.toc { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; }

/* --- печать / PDF инструкций */
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 14mm 13mm 16mm; }
  html, body { background: #fff; }
  body { font-size: 11.5px; line-height: 1.42; }
  .topbar, .no-print { display: none !important; }
  .print-only { display: block; }
  .wrap, .is-creator .wrap { max-width: none; padding: 0; }
  .card { box-shadow: none; border-color: #d6dad4; padding: 10px 14px; }
  .help section { margin-top: 8px; }
  .help table, .help .statuses, .help .links-ex, .help h2 + p { break-inside: avoid; page-break-inside: avoid; }
  .help h2 { break-after: avoid; page-break-after: avoid; }
  .help li, .help tr, .note, .toc { break-inside: avoid; page-break-inside: avoid; }
  .page-head { margin-bottom: 10px; }
  a { color: inherit; text-decoration: none; }
  .toc a { color: var(--accent); }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.print-head { display: none; }
@media print {
  .print-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted);
                border-bottom: 2px solid var(--accent); padding-bottom: 6px; margin-bottom: 14px; }
  .print-head b { color: var(--ink); font-size: 13px; }
  .print-head b span { color: var(--accent); }
}

/* --- публикации ролика на телефоне — карточками, без горизонтальной прокрутки */
@media (max-width: 640px) {
  .pubs-wrap { overflow-x: visible; }
  table.pubs, table.pubs tbody { display: block; }
  table.pubs thead { display: none; }
  table.pubs tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 12px 14px 8px;
                  border-bottom: 1px solid var(--line); }
  table.pubs tr.dim { padding-top: 0; padding-bottom: 12px; }
  table.pubs td { display: block; padding: 0; border: 0; background: none !important; }
  table.pubs td:first-child { flex-basis: 100%; }
  table.pubs tr.dim td { flex-basis: 100%; }
  table.pubs td.n { text-align: left; }
  table.pubs td[data-label]::before { content: attr(data-label) " "; color: var(--muted); font-size: 12px; font-weight: 400; }
  table.pubs td.t-actions { margin-left: auto; }
}
