/* «الفروع والامتياز», THE NETWORK — the panel's own pages (2026-10-09).
   network.js draws them; this file is only what they add on top of the
   console theme: KPI tiles, the alert rows, the bars, the sheet. Logical
   properties throughout, so Arabic and English read the same way round. */
.pl-net { max-width: 1180px; }
.net-page { display: flex; flex-direction: column; gap: var(--s3); }
.net-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.net-head-t h2 { margin: 0; font-size: 22px; }
.net-head-t .section-sub { margin: var(--s1) 0 0; max-width: 680px; }
.net-head-tools { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.net-head-tools select, .net-head-tools input { min-height: 40px; }
.net-back { margin-bottom: calc(var(--s2) * -1); }
.net-warn { color: var(--warn); }

.net-kpis { display: grid; gap: var(--s2); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.net-kpis.small { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.net-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s3) var(--s4);
  display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.net-kpi-l { font-size: var(--t-sm); color: var(--muted); }
.net-kpi-v { font-size: 19px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.net-kpi-v.bad, .bad { color: var(--danger); }
.good { color: var(--ok); }
.net-kpi-d { display: flex; gap: var(--s1); align-items: center; flex-wrap: wrap; min-height: 18px; }
.net-kpi-d .pl-hint { margin: 0; }
.net-delta { font-size: var(--t-xs); font-weight: 600; unicode-bidi: isolate; direction: ltr; color: var(--muted); }
.net-delta.good { color: var(--ok); }
.net-delta.bad { color: var(--danger); }

.net-counts { display: flex; flex-wrap: wrap; gap: var(--s2); }
.net-count { display: flex; align-items: baseline; gap: var(--s1); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px; font-size: var(--t-sm); color: var(--ink-2); }
.net-count strong { font-size: 15px; color: var(--ink); }

.net-grid { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.net-cards { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.net-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s4);
  display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.net-card > h3, .net-card-h { margin: 0; font-size: var(--t-md, 15px); }
.net-card-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; }
.net-card-top h3 { margin: 0; font-size: var(--t-md, 15px); }
.net-card.net-unread { border-inline-start: 4px solid var(--accent); }
.net-body { margin: 0; white-space: pre-wrap; line-height: 1.8; unicode-bidi: plaintext; }
.net-line { margin: 0; unicode-bidi: plaintext; }
.net-mini { display: flex; flex-wrap: wrap; gap: var(--s3); font-size: var(--t-sm); }
.net-mini > div { display: flex; flex-direction: column; gap: 2px; }
.net-mini span:first-child { color: var(--muted); }

.net-chips { display: flex; flex-wrap: wrap; gap: var(--s1); align-items: center; }
.net-chip { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: var(--t-xs); font-weight: 600;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; unicode-bidi: plaintext; }
.net-chip.accent { background: var(--accent-weak); color: var(--accent-press, var(--accent)); border-color: transparent; }
.net-chip.ok { background: var(--ok-weak, var(--surface-2)); color: var(--ok); border-color: transparent; }
.net-chip.warn { background: var(--warn-weak); color: var(--warn); border-color: transparent; }
.net-chip.danger { background: var(--danger-weak, var(--surface-2)); color: var(--danger); border-color: transparent; }

.net-alert { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s2) var(--s3);
  border-radius: var(--r-btn); background: var(--surface-2); border-inline-start: 4px solid var(--line); font-size: var(--t-sm); }
.net-alert.danger { border-inline-start-color: var(--danger); }
.net-alert.warn { border-inline-start-color: var(--warn); }
.net-alert.info { border-inline-start-color: var(--accent); }

.net-bars { width: 100%; height: auto; display: block; }
.net-bar { fill: var(--accent); opacity: .85; }
.net-bar-l { font-size: 12px; fill: var(--muted); }
.net-bar-v { font-size: 11px; fill: var(--ink-2); }
.net-rank { display: flex; flex-direction: column; gap: var(--s2); }
.net-rank-row { display: grid; grid-template-columns: minmax(90px, 1.1fr) 2fr auto; gap: var(--s2); align-items: center; font-size: var(--t-sm); }
.net-rank-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.net-rank-track { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.net-rank-fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

.net-tools { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.net-tools input[type="text"], .net-tools input:not([type]) { flex: 1 1 220px; min-height: 40px; }
.net-tools select { min-height: 40px; }
.net-t td, .net-t th { vertical-align: middle; }
.net-t th { white-space: nowrap; }
.net-t td:first-child { min-width: 160px; }
.net-t tr.net-click { cursor: pointer; }
.net-t tr.net-click:hover td, .net-t tr.net-click:focus-visible td { background: var(--surface-2); }
.net-t tr.net-click:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.net-t tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.net-sort { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: inherit; cursor: pointer; }
.net-sort:focus-visible { outline: 2px solid var(--accent); border-radius: 4px; }

.net-facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--s1) var(--s3); margin: 0; font-size: var(--t-sm); }
.net-facts dt { color: var(--muted); }
.net-facts dd { margin: 0; unicode-bidi: plaintext; white-space: pre-wrap; }
.net-hist { display: flex; gap: var(--s3); font-size: var(--t-sm); padding: 4px 0; border-bottom: 1px solid var(--line); }
.net-hist:last-child { border-bottom: 0; }
.net-hist .bnum { color: var(--muted); min-width: 130px; }

.net-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 999px; border: 1px solid var(--line); align-self: flex-start; }
.net-seg button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; font: inherit; font-size: var(--t-sm); color: var(--ink-2); cursor: pointer; min-height: 36px; }
.net-seg button.on { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.net-seg button:focus-visible { outline: 2px solid var(--accent); }

/* The sheet: a dialog over the page, a full screen on a phone. */
.net-sheet-back { position: fixed; inset: 0; z-index: 80; background: rgba(15, 10, 30, .45); display: flex; align-items: center; justify-content: center; padding: var(--s4); }
.net-sheet { background: var(--surface); color: var(--ink); border-radius: var(--r-card); width: min(640px, 100%); max-height: calc(100vh - 2 * var(--s4));
  overflow: auto; padding: var(--s4) var(--s5); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.net-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s3); position: sticky; top: calc(var(--s4) * -1);
  background: var(--surface); padding-top: var(--s2); z-index: 1; }
.net-sheet-head h3 { margin: 0; font-size: 17px; }
.net-form { display: flex; flex-direction: column; gap: var(--s3); }
.net-form.wide { min-width: min(720px, 100%); }
.net-field { display: flex; flex-direction: column; gap: 4px; }
.net-field[hidden] { display: none; }
.net-label { font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); margin: 0; }
.net-form input, .net-form select, .net-form textarea { min-height: 44px; width: 100%; box-sizing: border-box; }
.net-form textarea { min-height: 88px; resize: vertical; }
.net-check { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--t-sm); cursor: pointer; min-height: 32px; }
.net-check input { width: auto; min-height: auto; }
.net-checks { display: flex; flex-direction: column; gap: 4px; padding: var(--s2); border: 1px solid var(--line); border-radius: var(--r-btn); max-height: 220px; overflow: auto; }
.net-items { display: flex; flex-direction: column; gap: var(--s2); }
.net-item { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(160px, 2.4fr) 64px auto auto; gap: var(--s2); align-items: center; }
.net-item input, .net-item select { min-height: 40px; }
.net-visit { display: flex; flex-direction: column; gap: var(--s2); }
.net-vitem { display: grid; grid-template-columns: minmax(160px, 1.6fr) auto minmax(120px, 1fr); gap: var(--s2); align-items: center;
  padding: var(--s2); border: 1px solid var(--line); border-radius: var(--r-btn); }
.net-vitem.crit { border-inline-start: 4px solid var(--danger); }
.net-vtext { display: flex; gap: var(--s1); align-items: center; flex-wrap: wrap; font-size: var(--t-sm); }
.net-opts { display: inline-flex; gap: 4px; }
.net-opt { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px;
  font-size: var(--t-xs); cursor: pointer; min-height: 32px; }
.net-opt input { width: auto; min-height: auto; margin: 0; }
.net-opt.pass:has(input:checked) { background: var(--ok-weak, var(--surface-2)); border-color: var(--ok); color: var(--ok); }
.net-opt.fail:has(input:checked) { background: var(--danger-weak, var(--surface-2)); border-color: var(--danger); color: var(--danger); }
.net-opt.na:has(input:checked) { background: var(--surface-2); border-color: var(--muted); }
.net-score { margin: 0; font-weight: 700; }
.net-score.good { color: var(--ok); }
.net-score.bad { color: var(--danger); }
.net-readers { border-top: 1px dashed var(--line); padding-top: var(--s2); }

.net-ok { position: fixed; inset-inline: 0; bottom: var(--s4); margin: 0 auto; width: fit-content; max-width: calc(100% - 2 * var(--s4));
  background: var(--ink); color: var(--surface); padding: var(--s2) var(--s4); border-radius: 999px; font-size: var(--t-sm);
  z-index: 90; opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity 200ms cubic-bezier(0.23, 1, 0.32, 1), transform 200ms cubic-bezier(0.23, 1, 0.32, 1); }
.net-ok.on { opacity: 1; transform: none; }
.net-ok.bad { background: var(--danger); }
@media (prefers-reduced-motion: reduce) { .net-ok { transition: opacity 150ms ease; transform: none; } }

@media (max-width: 720px) {
  .net-sheet-back { padding: 0; align-items: stretch; }
  .net-sheet { width: 100%; max-height: 100vh; border-radius: 0; padding: var(--s3) var(--s4); }
  .net-item { grid-template-columns: 1fr 1fr; }
  .net-item input:nth-child(2) { grid-column: 1 / -1; order: -1; }
  .net-vitem { grid-template-columns: 1fr; }
  .net-grid, .net-cards { grid-template-columns: 1fr; }
  .net-head-t h2 { font-size: 19px; }
}
