/* מסך ביצועים — מאפייני CSS לוגיים בלבד, צבעים מהטוקנים (בהיר/כהה) */
.an-page .an-filters { align-items: center; }
.an-body > * + * { margin-block-start: 16px; }
.an-pad { padding: 16px 18px 0; }

/* בורר מקטעים (טווח / מדד) */
.an-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.an-seg-btn { min-block-size: 36px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.an-seg-btn:hover { color: var(--text); background: var(--surface-3); }
.an-seg-btn[aria-pressed="true"] { background: var(--surface); color: var(--brand-text); box-shadow: var(--shadow-sm); }
.an-seg-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.an-seg-sm .an-seg-btn { min-block-size: 32px; padding: 0 10px; font-size: 13.5px; }
@media (max-width: 767px) {
  .an-filters .an-seg { inline-size: 100%; }
  .an-filters .an-seg .an-seg-btn { flex: 1 1 0; padding: 0 6px; }
  .an-seg-btn { min-block-size: 40px; }
}

/* מדדים מרכזיים */
.an-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1000px) { .an-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.an-kpi { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); min-inline-size: 0; }
.an-kpi-icon { inline-size: 40px; block-size: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); flex: none; }
.an-kpi-text { display: flex; flex-direction: column; gap: 2px; min-inline-size: 0; }
.an-kpi-label { font-size: 13px; color: var(--text-2); font-weight: 600; }
.an-kpi-value { font-size: 26px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.an-kpi-sub { font-size: 12.5px; color: var(--text-3); }
@media (max-width: 767px) {
  .an-kpi { flex-direction: column; gap: 8px; padding: 12px; }
  .an-kpi-icon { inline-size: 34px; block-size: 34px; border-radius: 10px; }
  .an-kpi-value { font-size: 22px; }
}

/* גרף */
.an-chart-head { flex-wrap: wrap; }
.an-chart { position: relative; inline-size: 100%; min-block-size: 200px; }
.an-svg { display: block; inline-size: 100%; block-size: auto; overflow: visible; }
.an-grid line { stroke: var(--border); stroke-width: 1; }
.an-axis { fill: var(--text-3); font-size: 11.5px; font-family: var(--font); }
.an-bars rect { fill: var(--brand); }
.an-bars rect:hover { fill: var(--brand-hover); }
.an-line { fill: none; stroke: var(--brand); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.an-dots circle { fill: var(--surface); stroke: var(--brand); stroke-width: 2; }
.an-chart-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 16px; text-align: center; color: var(--text-3); font-size: 14px; }
.an-chart-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-block-start: 8px; }
.an-chart-foot p { margin: 0; }
.an-table-wrap { overflow-x: auto; margin-block-start: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); max-block-size: 360px; overflow-y: auto; }
.an-table { inline-size: 100%; border-collapse: collapse; font-size: 13.5px; }
.an-table th, .an-table td { padding: 8px 10px; text-align: start; border-block-end: 1px solid var(--border); white-space: nowrap; }
.an-table thead th { position: sticky; inset-block-start: 0; background: var(--surface-2); color: var(--text-2); font-weight: 700; }
.an-table td { font-variant-numeric: tabular-nums; }
.an-table tbody th { font-weight: 500; color: var(--text-2); }

/* פוסטים מובילים + ערוצים */
.an-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.an-grid > .card { margin: 0; }
@media (max-width: 1000px) { .an-grid { grid-template-columns: minmax(0, 1fr); } }
.an-top-list, .an-ch-list, .an-note-list, .an-post-list { list-style: none; margin: 0; padding: 0; }
.an-top { display: flex; align-items: center; gap: 12px; padding: 12px 18px; text-decoration: none; color: inherit; border-block-end: 1px solid var(--border); min-block-size: 72px; }
.an-top-list li:last-child .an-top { border-block-end: 0; }
.an-top:hover { background: var(--surface-2); }
.an-top:focus-visible { outline: none; box-shadow: inset var(--focus); }
.an-rank { inline-size: 24px; flex: none; text-align: center; font-weight: 800; color: var(--text-3); }
.an-thumb { inline-size: 56px; block-size: 56px; flex: none; border-radius: 10px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--text-3); }
.an-thumb img { inline-size: 100%; block-size: 100%; object-fit: cover; display: block; }
.an-top-main { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; gap: 2px; }
.an-top-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-top-sub { font-size: 13px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-top-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.an-top-stats > span { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); }
.an-top-stats .icon { color: var(--text-3); }
.an-rate { font-weight: 700; color: var(--success-text) !important; }

.an-ch { padding: 14px 18px; border-block-end: 1px solid var(--border); }
.an-ch:last-child { border-block-end: 0; }
.an-ch-head { display: flex; align-items: center; gap: 10px; }
.an-ch-name { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; }
.an-ch-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-block-start: 10px; }
@media (max-width: 1280px) { .an-ch-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.an-ch-stat { display: flex; flex-direction: column; min-inline-size: 0; }
.an-ch-stat-label { font-size: 12px; color: var(--text-3); }
.an-ch-stat-value { font-weight: 700; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-level { flex: none; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.an-level.ok { background: var(--success-soft); color: var(--success-text); }
.an-level.partial, .an-level.pending { background: var(--warning-soft); color: var(--warning-text); }
.an-level.error { background: var(--danger-soft); color: var(--danger-text); }

/* הערות זמינות */
.an-note-list { display: flex; flex-direction: column; gap: 10px; margin-block-start: 12px; }
.an-note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--info-soft); color: var(--info-text); font-size: 14px; }
.an-note.error { background: var(--danger-soft); color: var(--danger-text); }
.an-note.partial, .an-note.pending { background: var(--warning-soft); color: var(--warning-text); }
.an-note strong { display: block; }
.an-note-text { display: block; }

/* בלוק מדדים לפוסט (לעורך) */
.an-post-block { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.an-post-title { font-size: 15px; font-weight: 700; margin-block-end: 8px; }
.an-post-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding-block: 6px; border-block-end: 1px solid var(--border); }
.an-post-row:last-child { border-block-end: 0; }
.an-post-ch { font-weight: 600; }
.an-post-stats { display: inline-flex; gap: 12px; color: var(--text-2); font-size: 13.5px; }
