/* Стили TrendForge — перенесены 1-в-1 из утверждённых мокапов design/*.html. */

  :root {
    --bg: #f5f7fa;
    --surface: #ffffff;
    --surface-2: #f0f3f7;
    --line: #e2e7ee;
    --text: #1d2430;
    --muted: #667085;
    --accent: #2563eb;
    --accent-soft: #e8f0fe;
    --ok: #16a34a;     --ok-soft: #e7f6ec;
    --warn: #d97706;   --warn-soft: #fdf3e2;
    --err: #dc2626;    --err-soft: #fdecec;
    --violet: #7c3aed; --violet-soft: #f1ebfd;
    --radius: 10px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  }
  * { box-sizing: border-box; }
  body { margin: 0; font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.45; }
  a { color: var(--accent); text-decoration: none; }

  .shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
  .side { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; }
  .logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; padding: 4px 10px 20px; }
  .logo-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 15px; }
  .nav a { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 8px; color: var(--text); font-weight: 500; }
  .nav a:hover { background: var(--surface-2); }
  .nav a.active { background: var(--accent-soft); color: var(--accent); }
  .nav .count { font-size: 12px; background: var(--surface-2); color: var(--muted); border-radius: 20px; padding: 1px 8px; }
  .nav a.active .count { background: #fff; color: var(--accent); }
  .side-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
  .side-foot b { color: var(--text); font-weight: 600; }

  .main { padding: 24px 32px 40px; min-width: 0; }
  .top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
  h1 { font-size: 22px; margin: 0; letter-spacing: -0.01em; }
  .sub { color: var(--muted); margin-top: 2px; }
  .seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 3px; }
  .seg span { padding: 5px 12px; border-radius: 6px; color: var(--muted); font-weight: 500; }
  .seg span.on { background: var(--accent-soft); color: var(--accent); }
  .btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 7px 14px; border-radius: 8px; font: inherit; font-weight: 500; cursor: pointer; }
  .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
  .actions { display: flex; gap: 10px; align-items: center; }

  .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
  .card-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
  .card-h h2 { font-size: 15px; margin: 0; }
  .card-b { padding: 16px 18px; }

  .kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 16px; }
  .kpi { padding: 16px 18px; }
  .kpi .label { color: var(--muted); font-size: 13px; }
  .kpi .val { font-size: 26px; font-weight: 700; margin-top: 4px; letter-spacing: -0.02em; }
  .kpi .delta { font-size: 12px; color: var(--muted); margin-top: 2px; }
  .kpi .delta.up { color: var(--ok); }
  .kpi .delta.down { color: var(--err); }

  .grid2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 16px; }

  .funnel { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
  .step { background: var(--surface-2); border-radius: 8px; padding: 12px 10px; position: relative; }
  .step .n { font-size: 20px; font-weight: 700; }
  .step .t { font-size: 12px; color: var(--muted); margin-top: 2px; }
  .step .bar { height: 4px; border-radius: 4px; background: var(--line); margin-top: 10px; overflow: hidden; }
  .step .bar i { display: block; height: 100%; background: var(--accent); }
  .step.hot { background: var(--warn-soft); }
  .step.hot .bar i { background: var(--warn); }
  .step.done { background: var(--ok-soft); }
  .step.done .bar i { background: var(--ok); }
  .funnel-note { margin-top: 14px; color: var(--muted); font-size: 13px; }

  .budget .big { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
  .budget .big small { font-size: 14px; color: var(--muted); font-weight: 500; }
  .meter { height: 8px; background: var(--surface-2); border-radius: 8px; overflow: hidden; margin: 10px 0 14px; }
  .meter i { display: block; height: 100%; width: 62%; background: var(--accent); }
  .rows { display: grid; gap: 8px; }
  .row { display: flex; justify-content: space-between; }
  .row span:first-child { color: var(--muted); }

  table { width: 100%; border-collapse: collapse; }
  th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 18px; border-bottom: 1px solid var(--line); background: #fafbfc; }
  td { padding: 11px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
  tr:last-child td { border-bottom: 0; }
  .vid { display: flex; align-items: center; gap: 12px; }
  .thumb { width: 36px; height: 56px; border-radius: 6px; object-fit: cover; background: var(--surface-2); flex: none; }
  .vid .ttl { font-weight: 600; }
  .vid .src { font-size: 12px; color: var(--muted); }
  .tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 20px; white-space: nowrap; }
  .tag.review { background: var(--warn-soft); color: var(--warn); }
  .tag.published { background: var(--ok-soft); color: var(--ok); }
  .tag.generating { background: var(--violet-soft); color: var(--violet); }
  .tag.scripted { background: var(--accent-soft); color: var(--accent); }
  .tag.failed { background: var(--err-soft); color: var(--err); }
  .plats { display: flex; gap: 4px; }
  .plat { font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 5px; background: var(--surface-2); color: var(--muted); }
  .plat.on { background: var(--ok-soft); color: var(--ok); }
  .plat.priv { background: var(--warn-soft); color: var(--warn); }
  .num { text-align: right; font-variant-numeric: tabular-nums; }

  .alerts { list-style: none; margin: 0; padding: 0; }
  .alerts li { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
  .alerts li:last-child { border-bottom: 0; }
  .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
  .dot.err { background: var(--err); } .dot.warn { background: var(--warn); } .dot.info { background: var(--accent); }
  .alerts .when { font-size: 12px; color: var(--muted); }

  .divider { margin: 40px 0 16px; padding-top: 16px; border-top: 2px dashed var(--line); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
  .empty { text-align: center; padding: 48px 24px; color: var(--muted); }
  .empty .ico { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 22px; }
  .empty h3 { color: var(--text); margin: 0 0 4px; font-size: 16px; }

  @media (max-width: 1100px) {
    .kpis { grid-template-columns: repeat(3, 1fr); }
    .grid2 { grid-template-columns: 1fr; }
    .funnel { grid-template-columns: repeat(4, 1fr); }
  }
  @media (max-width: 760px) {
    .shell { grid-template-columns: 1fr; }
    .side { flex-direction: row; overflow-x: auto; padding: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
    .logo { padding: 4px 10px; }
    .nav { display: flex; gap: 4px; }
    .side-foot { display: none; }
    .main { padding: 18px 14px; }
    .kpis { grid-template-columns: repeat(2, 1fr); }
    .funnel { grid-template-columns: repeat(2, 1fr); }
    .hide-sm { display: none; }
  }

/* карточка ролика */
  .crumbs { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
  .crumbs a { color: var(--muted); }
  .title-row { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
  .stages { display:flex; gap:0; margin: 4px 0 20px; background: var(--surface); border:1px solid var(--line); border-radius: var(--radius); overflow:hidden; }
  .stage { flex:1; padding:10px 12px; font-size:12px; color: var(--muted); border-right:1px solid var(--line); }
  .stage:last-child { border-right:0; }
  .stage b { display:block; font-size:13px; color: var(--text); font-weight:600; }
  .stage.done { background: #fafbfc; }
  .stage.done b::before { content:"✓ "; color: var(--ok); }
  .stage.now { background: var(--warn-soft); }
  .stage.now b { color: var(--warn); }
  .layout { display:grid; grid-template-columns: 300px 1fr; gap:16px; align-items:start; }
  .player { background:#0f1623; border-radius: var(--radius); aspect-ratio: 9/16; position:relative; overflow:hidden; }
  .player img { width:100%; height:100%; object-fit:cover; opacity:.85; }
  .player .play { position:absolute; inset:0; display:grid; place-items:center; }
  .player .play span { width:56px; height:56px; border-radius:50%; background:rgba(255,255,255,.92); display:grid; place-items:center; color: var(--accent); font-size:20px; }
  .player .ai { position:absolute; top:10px; right:10px; background:rgba(0,0,0,.55); color:#fff; font-size:11px; font-weight:700; padding:2px 7px; border-radius:5px; }
  .player .subs { position:absolute; left:12px; right:12px; bottom:18%; text-align:center; color:#fff; font-weight:700; font-size:15px; text-shadow:0 1px 3px rgba(0,0,0,.8); }
  .timeline { display:flex; height:10px; border-radius:6px; overflow:hidden; margin:12px 0 6px; }
  .timeline i { display:block; height:100%; }
  .t-av { background: var(--accent); } .t-don { background: var(--warn); }
  .legend { display:flex; justify-content:space-between; font-size:12px; color: var(--muted); }
  .legend b { color: var(--text); }
  .sidebox { margin-top:14px; }
  .kv { display:grid; grid-template-columns: 130px 1fr; gap:8px 12px; font-size:13px; }
  .kv dt { color: var(--muted); } .kv dd { margin:0; }
  .stack { display:grid; gap:16px; }
  .script { display:grid; gap:12px; }
  .part { border:1px solid var(--line); border-radius:8px; padding:12px 14px; }
  .part .ph { display:flex; justify-content:space-between; font-size:12px; color: var(--muted); margin-bottom:6px; }
  .part .ph b { color: var(--text); font-size:13px; }
  .part.don { background: var(--warn-soft); border-color: #f5e0bd; }
  .part p { margin:0; }
  .tabs { display:flex; gap:4px; padding: 0 18px; border-bottom:1px solid var(--line); }
  .tabs span { padding:11px 12px; font-weight:500; color: var(--muted); border-bottom:2px solid transparent; margin-bottom:-1px; }
  .tabs span.on { color: var(--accent); border-color: var(--accent); }
  .field { margin-bottom:12px; }
  .field label { display:block; font-size:12px; color: var(--muted); margin-bottom:4px; }
  .field .box { border:1px solid var(--line); border-radius:8px; padding:9px 12px; background:#fff; }
  .hash { color: var(--accent); }
  .log { list-style:none; margin:0; padding:0; }
  .log li { display:grid; grid-template-columns: 90px 1fr auto; gap:12px; padding:10px 18px; border-bottom:1px solid var(--line); font-size:13px; }
  .log li:last-child { border-bottom:0; }
  .log .when { color: var(--muted); }
  .log .cost { color: var(--muted); font-variant-numeric: tabular-nums; }
  .note { font-size:12px; color: var(--muted); }
  @media (max-width: 1100px) { .layout { grid-template-columns: 1fr; } .player { max-width:300px; } .stages { flex-wrap:wrap; } .stage { flex: 1 1 30%; } }

/* списки, публикации, расходы, настройки, вход */
  .filters { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:14px; }
  .input { border:1px solid var(--line); border-radius:8px; padding:7px 12px; background:#fff; font:inherit; color:var(--text); min-width:0; }
  .input.search { width:260px; }
  .chip { border:1px solid var(--line); background:#fff; border-radius:20px; padding:5px 12px; font-weight:500; color:var(--muted); }
  .chip.on { background:var(--accent-soft); border-color:#c9dafc; color:var(--accent); }
  .score { font-weight:700; font-variant-numeric: tabular-nums; }
  .score.hi { color: var(--ok); } .score.mid { color: var(--warn); } .score.lo { color: var(--muted); }
  .reason { font-size:12px; color: var(--err); }
  .muted { color: var(--muted); }
  .tag.muted-t { background: var(--surface-2); color: var(--muted); }
  .tag.analyzed { background: var(--accent-soft); color: var(--accent); }
  .pager { display:flex; justify-content:space-between; align-items:center; padding:12px 18px; border-top:1px solid var(--line); color:var(--muted); font-size:13px; }
  .limits { display:grid; grid-template-columns: repeat(3,1fr); gap:14px; margin-bottom:16px; }
  .limit .meter { margin:8px 0 6px; }
  .limit .meter i { width: var(--w); }
  .limit .meter.ok i { background: var(--ok); }
  .limit .meter.warn i { background: var(--warn); }
  .days { display:grid; grid-template-columns: 110px repeat(3,1fr); }
  .days > div { padding:10px 14px; border-bottom:1px solid var(--line); border-right:1px solid var(--line); }
  .days .h { font-size:12px; color:var(--muted); font-weight:600; background:#fafbfc; }
  .days .time { color:var(--muted); font-variant-numeric: tabular-nums; }
  .slot { border-radius:6px; padding:6px 9px; font-size:12px; font-weight:500; }
  .slot.pub { background:var(--ok-soft); color:#166534; }
  .slot.priv { background:var(--warn-soft); color:#92400e; }
  .slot.plan { background:var(--accent-soft); color:#1e40af; }
  .slot.free { border:1px dashed var(--line); color:var(--muted); }
  .bars { display:flex; align-items:flex-end; gap:10px; height:160px; padding-top:10px; }
  .bars .b { flex:1; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; gap:6px; height:100%; font-size:11px; color:var(--muted); }
  .bars .col { width:100%; max-width:44px; display:flex; flex-direction:column; border-radius:5px 5px 0 0; overflow:hidden; }
  .bars .hg { background: var(--accent); } .bars .llm { background: #93b4f5; }
  .bars .limit-line { position:relative; }
  .form-grid { display:grid; grid-template-columns: 220px 1fr; gap:22px 28px; }
  .form-grid .lbl b { display:block; font-size:14px; }
  .form-grid .lbl span { font-size:12px; color:var(--muted); }
  textarea.input { width:100%; min-height:110px; resize:vertical; line-height:1.5; }
  .pills { display:flex; flex-wrap:wrap; gap:6px; border:1px solid var(--line); border-radius:8px; padding:7px; background:#fff; }
  .pill { background:var(--surface-2); border-radius:6px; padding:3px 9px; font-size:13px; }
  .pill i { font-style:normal; color:var(--muted); margin-left:6px; }
  .row3 { display:grid; grid-template-columns: repeat(3,1fr); gap:10px; }
  .row3 label, .inline label { font-size:12px; color:var(--muted); display:block; margin-bottom:4px; }
  .row3 .input, .inline .input { width:100%; }
  .range { display:flex; align-items:center; gap:12px; }
  .range input { flex:1; accent-color: var(--accent); }
  .versions { font-size:12px; color:var(--muted); margin-top:6px; }
  .section-t { font-size:12px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); font-weight:600; margin:28px 0 12px; }
  .savebar { position:sticky; bottom:0; background:rgba(245,247,250,.94); padding:14px 0; display:flex; justify-content:flex-end; gap:10px; border-top:1px solid var(--line); margin-top:24px; }
  .auth { min-height:100vh; display:grid; place-items:center; padding:24px; }
  .auth-card { width:100%; max-width:380px; padding:32px 28px; }
  .auth-card .logo { justify-content:center; padding:0 0 22px; font-size:20px; }
  .auth-card .field { margin-bottom:14px; }
  .auth-card label { display:block; font-size:13px; font-weight:500; margin-bottom:5px; }
  .auth-card .input { width:100%; padding:10px 12px; }
  .auth-card .btn { width:100%; justify-content:center; padding:10px; }
  .err-box { background:var(--err-soft); color:var(--err); border-radius:8px; padding:9px 12px; font-size:13px; margin-bottom:14px; }
  @media (max-width: 1100px) { .limits { grid-template-columns:1fr; } .form-grid { grid-template-columns:1fr; gap:8px; } .form-grid .lbl { margin-top:14px; } .days { grid-template-columns: 80px repeat(3, minmax(120px,1fr)); overflow-x:auto; } }

/* дополнение к карточке входа: ссылки, пояснения, уведомление */
.auth-links { text-align:center; margin-top:14px; font-size:13px; }
.auth-text { color: var(--muted); margin: 0 0 14px; font-size:13px; }
.flash-box { background:var(--accent-soft); color:var(--accent); border-radius:8px; padding:9px 12px; font-size:13px; margin-bottom:14px; }
.auth-card table td { padding:8px 0; }

/* дополнения панели: состояния, которых нет в мокапе как отдельных блоков */
.plat.err { background: var(--err-soft); color: var(--err); }
.demo-box { background: var(--warn-soft); color: #92400e; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.main > .flash-box, .main > .err-box { margin-bottom: 16px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; font-size: 12px; }
.linkbtn:hover { color: var(--accent); }
a.vid { color: inherit; }
a.vid:hover .ttl { color: var(--accent); }
.stage.fail { background: var(--err-soft); }
.stage.fail b { color: var(--err); }
.inline-form { display: inline; }
.decide { display: grid; gap: 10px; }
.decide textarea { min-height: 60px; }
details.more summary { cursor: pointer; color: var(--accent); font-weight: 500; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
.video-el { width: 100%; height: 100%; object-fit: cover; background: #0f1623; }
.player .placeholder { position:absolute; inset:0; display:grid; place-items:center; color:#cbd5e1; font-size:13px; text-align:center; padding:20px; }
.seg a { color: inherit; }
a.chip:hover { color: var(--accent); }
.tabs a { color: inherit; }
.box-input { width: 100%; }
textarea.box-input { min-height: 80px; }
.slot.fail { background: var(--err-soft); color: var(--err); }
a.slot:hover { filter: brightness(.97); }
