@font-face {
  font-family: 'Vazirmatn';
  src: url('../vendor/vazirmatn/vazirmatn-arabic-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../vendor/vazirmatn/vazirmatn-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../vendor/jetbrains-mono/jetbrains-mono-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}
:root {
  --bs-body-font-family: 'Vazirmatn', system-ui, sans-serif;
  --tp-bg: #f6f4ef;
  --tp-ink: #1f2328;
  --tp-muted: #6b6f76;
  --tp-card: #ffffff;
  --tp-line: #e6e1d7;
  --tp-accent: #7a2e2a;      /* لاکی فرش */
  --tp-accent-2: #1d4e5f;    /* سرمه‌ای */
  --tp-pos: #2f7d4f;
  --tp-neu: #a8a29e;
  --tp-neg: #b3261e;
}
body { font-family: var(--bs-body-font-family); background: var(--tp-bg); color: var(--tp-ink); font-size: .95rem; }
.tp-nav { background: var(--tp-ink); }
.tp-nav .navbar-brand { font-weight: 800; letter-spacing: -.5px; color: #fff; }
.tp-nav .navbar-brand span { color: #e9b872; }
.tp-nav .nav-link { color: #d6d3cd; }
.tp-nav .nav-link.active, .tp-nav .nav-link:hover { color: #fff; }
.tp-card { background: var(--tp-card); border: 1px solid var(--tp-line); border-radius: 14px; padding: 1rem 1.1rem; }
.tp-card h2, .tp-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: .8rem; }
.kpi { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.kpi-label { color: var(--tp-muted); font-size: .8rem; }
.mood { display: flex; height: 8px; border-radius: 6px; overflow: hidden; background: var(--tp-line); min-width: 90px; }
.mood > i { display: block; height: 100%; }
.mood .p { background: var(--tp-pos); } .mood .n { background: var(--tp-neu); } .mood .g { background: var(--tp-neg); }
.badge-pos { background: #e3f1e8; color: var(--tp-pos); }
.badge-neg { background: #f8e3e1; color: var(--tp-neg); }
.badge-neu { background: #efedea; color: #57534e; }
.badge-intent { background: #e6eef1; color: var(--tp-accent-2); }
.table { --bs-table-bg: transparent; }
.table thead th { color: var(--tp-muted); font-weight: 600; font-size: .8rem; border-bottom-color: var(--tp-line); }
.table td { border-color: var(--tp-line); vertical-align: middle; }
.up { color: var(--tp-pos); } .down { color: var(--tp-neg); }
.comment-text { max-width: 520px; white-space: pre-wrap; }
.alert-item { border-inline-start: 4px solid var(--tp-accent); background: #fff; border-radius: 10px; padding: .6rem .8rem; }
.mono, code, pre { font-family: 'JetBrains Mono', 'Vazirmatn', monospace; direction: ltr; unicode-bidi: embed; }
a { color: var(--tp-accent-2); }
.period a { text-decoration: none; padding: .2rem .6rem; border-radius: 20px; color: var(--tp-muted); }
.period a.on { background: var(--tp-ink); color: #fff; }
.dot { display:inline-block; width:9px; height:9px; border-radius:50%; }
.dot.ok { background: var(--tp-pos); } .dot.bad { background: var(--tp-neg); }
@media (max-width: 576px) { .kpi { font-size: 1.25rem; } .comment-text { max-width: 260px; } }

/* پنل مدیریت */
.tp-side { background: var(--tp-card); border: 1px solid var(--tp-line); border-radius: 14px; padding: .6rem; position: sticky; top: 1rem; }
.tp-side-title { font-weight: 800; font-size: .8rem; color: var(--tp-muted); padding: .3rem .6rem .5rem; }
.tp-side a { display: block; padding: .5rem .7rem; border-radius: 9px; color: var(--tp-ink); text-decoration: none; font-size: .9rem; }
.tp-side a:hover { background: var(--tp-bg); }
.tp-side a.on { background: var(--tp-ink); color: #fff; }
.tp-side a.tp-side-muted { color: var(--tp-muted); font-size: .8rem; border-top: 1px solid var(--tp-line); margin-top: .4rem; border-radius: 0; }
.tp-manage-link { color: #e9b872 !important; }
.step { display: flex; gap: .7rem; align-items: flex-start; padding: .7rem 0; border-bottom: 1px solid var(--tp-line); }
.step:last-child { border-bottom: 0; }
.step-dot { width: 26px; height: 26px; border-radius: 50%; flex: 0 0 26px; display: grid; place-items: center; font-size: .8rem; font-weight: 700; background: var(--tp-line); color: var(--tp-muted); }
.step-dot.ok { background: #e3f1e8; color: var(--tp-pos); }
.status-pill { display: inline-block; padding: .15rem .6rem; border-radius: 20px; font-size: .78rem; font-weight: 600; }
.st-active { background: #e3f1e8; color: var(--tp-pos); }
.st-new, .st-disabled { background: #efedea; color: #57534e; }
.st-challenge { background: #fff3d6; color: #8a5a00; }
.st-resting { background: #e6eef1; color: var(--tp-accent-2); }
.st-blocked { background: #f8e3e1; color: var(--tp-neg); }
.crawler-card { border: 1px solid var(--tp-line); border-radius: 12px; padding: 1rem; background: #fff; }
.code-box { background: #fff8e6; border: 1px dashed #d9a53a; border-radius: 10px; padding: .8rem; }
.log-line { font-size: .78rem; color: var(--tp-muted); }
.log-line.error { color: var(--tp-neg); } .log-line.warn { color: #8a5a00; }
.form-label { font-size: .85rem; font-weight: 600; }
.form-text { font-size: .75rem; }
.win-row { display: flex; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.win-row input { max-width: 120px; direction: ltr; text-align: center; }
.ts-wrapper.form-select { padding: 0; }
@media (max-width: 991px) {
  .tp-side { position: static; display: flex; overflow-x: auto; gap: .2rem; white-space: nowrap; padding: .4rem; }
  .tp-side-title { display: none; }
  .tp-side a { flex: 0 0 auto; font-size: .82rem; padding: .4rem .6rem; }
  .tp-side a.tp-side-muted { border-top: 0; margin: 0; }
}
