/* ISP Nexus — هوية كحلي وذهبي، عربي من اليمين، للموبايل أولاً */
:root {
  --bg: #0C1A2C;
  --bg-2: #0F2036;
  --surface: #142740;
  --raised: #1B3352;
  --line: rgba(160, 190, 230, .12);
  --line-2: rgba(160, 190, 230, .22);
  --text: #EDF2F9;
  --muted: #8EA2BE;
  --faint: #5F7594;
  --gold: #D4AF5A;
  --gold-2: #F1DA9A;
  --gold-ink: #2A1F05;
  --ok: #3CC48F;
  --warn: #F2A93B;
  --bad: #EF5D5D;
  --info: #5AAAFF;
  --r-s: 10px;
  --r-m: 16px;
  --r-l: 24px;
  --nav-h: 66px;
  --font: 'Readex Pro', 'Segoe UI', Tahoma, system-ui, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #EEF2F7; --bg-2: #E6ECF4; --surface: #FFFFFF; --raised: #F3F6FA;
  --line: rgba(20, 40, 70, .10); --line-2: rgba(20, 40, 70, .18);
  --text: #0F2036; --muted: #556A87; --faint: #8193AB;
  --gold: #A9822B; --gold-2: #C9A24A; --gold-ink: #fff;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root { padding-top: env(safe-area-inset-top, 0px); }
html, body { margin: 0; height: 100%; overscroll-behavior-y: contain; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold-2); text-decoration: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.btn:active, .chip:active, .item:active, .pillsel:active, .plusbtn:active, .iconbtn:active, .tile:active {
  transform: scale(0.97); transition: transform 0.08s ease;
}
.num { font-feature-settings: "tnum"; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.gold { color: var(--gold-2); }
.ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- الهيكل ---------- */
#app { min-height: 100%; }
.page { max-width: 640px; margin: 0 auto; padding: 14px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom, 0px)); }
.page.wide { max-width: 980px; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .in { max-width: 640px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; min-height: 56px; }
.page.wide ~ .topbar .in, .topbar.wide .in { max-width: 980px; }
.topbar h1 { font-size: 17.5px; font-weight: 600; margin: 0; flex: 1; min-width: 0; display: flex; align-items: center; }
.topbar-title-wrap { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-title-wrap svg { width: 22px; height: 22px; color: var(--gold-2); flex: none; }
.topbar-actions { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.hide-mobile { display: inline; }
.iconbtn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  display: inline-grid; place-items: center; cursor: pointer; color: var(--text); flex: none; position: relative;
}
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn .dot { position: absolute; top: -4px; left: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; display: grid; place-items: center; }

.nav {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 30; height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: color-mix(in srgb, var(--bg-2) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); display: flex; justify-content: center;
}
.nav .in { display: flex; width: 100%; max-width: 640px; }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint); font-size: 11.5px; position: relative; }
.nav a svg { width: 23px; height: 23px; }
.nav a.on { color: var(--gold-2); }
.nav a.on::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); }

/* ---------- مكونات ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px; }
.card.flat { background: transparent; }
.card h3 { margin: 0 0 10px; font-size: 15px; font-weight: 600; }
.section-title { font-size: 13px; color: var(--muted); margin: 22px 4px 8px; font-weight: 500; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
  border-radius: 14px; border: 1px solid var(--line-2); background: var(--raised); color: var(--text);
  cursor: pointer; font-weight: 500; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--gold-ink); border-color: transparent; font-weight: 600; }
.btn.danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 12px; border-radius: 11px; font-size: 13.5px; }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.loading { pointer-events: none; opacity: .75; }
.btn.loading::after { content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin: 0 4px 6px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text); outline: none;
}
textarea.input { min-height: 120px; resize: vertical; line-height: 1.7; }
.input:focus { border-color: var(--gold); }
.input[dir="ltr"] { text-align: left; }
.hint { font-size: 12.5px; color: var(--faint); margin: 6px 4px 0; }

.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; border-radius: 20px; background: var(--raised); border: 1px solid var(--line-2); transition: .2s; cursor: pointer; }
.switch i::after { content: ""; position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: .2s; }
.switch input:checked + i { background: color-mix(in srgb, var(--gold) 35%, var(--raised)); border-color: var(--gold); }
.switch input:checked + i::after { right: 23px; background: var(--gold-2); }

.seg { display: flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.seg button { flex: 1; min-height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 500; }
.seg button.on { background: var(--raised); color: var(--gold-2); box-shadow: inset 0 0 0 1px var(--line-2); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; white-space: nowrap; min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
.chip.on { border-color: var(--gold); color: var(--gold-2); background: color-mix(in srgb, var(--gold) 10%, var(--surface)); }
.chip b { font-weight: 600; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 500; background: var(--raised); color: var(--muted); }
.badge svg { width: 14px; height: 14px; }
.badge.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.badge.bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.badge.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.badge.gold { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold-2); }
.badge.info { background: color-mix(in srgb, var(--info) 16%, transparent); color: var(--info); }

.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--line); cursor: pointer; color: var(--text); }
.item:last-child { border-bottom: 0; }
.item .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--raised); color: var(--gold-2); flex: none; }
.item .ic svg { width: 19px; height: 19px; }
.item .chev { color: var(--faint); width: 18px; height: 18px; flex: none; }
.item .t { font-weight: 500; }
.item .s { font-size: 12.5px; color: var(--muted); }

/* ---------- بطاقة اللوحة والتنقل التفاعلي ---------- */
.cards-rail-container {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 -4px 4px;
}
.cards-rail {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 6px 4px 10px;
  margin: 0;
  width: 100%;
  scrollbar-width: none;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.cards-rail::-webkit-scrollbar { display: none; }

.rail-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 15;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(13, 24, 42, 0.90);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(241, 218, 154, 0.35);
  color: var(--gold-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
}
.rail-nav-btn:hover:not(:disabled) {
  background: rgba(22, 38, 66, 0.98);
  border-color: var(--gold);
  transform: translateY(-50%) scale(1.12);
  color: #FFF3D2;
  box-shadow: 0 6px 22px rgba(212, 175, 55, 0.3);
}
.rail-nav-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
  pointer-events: none;
}
.rail-nav-btn.prev {
  right: -6px;
}
.rail-nav-btn.next {
  left: -6px;
}
.rail-nav-btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.pcard {
  scroll-snap-align: center;
  flex: 0 0 100%;
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  aspect-ratio: 1.68;
  min-height: 180px;
  padding: 18px 20px;
  color: #F6EBCB;
  cursor: pointer;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(241, 218, 154, .22), transparent 55%),
    radial-gradient(90% 120% at 0% 100%, rgba(30, 70, 130, .55), transparent 60%),
    linear-gradient(135deg, #10284A 0%, #0B1B33 55%, #142F57 100%);
  border: 2px solid transparent;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .06);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
  user-select: none;
  -webkit-user-select: none;
}
.pcard:focus-visible {
  outline: none;
  border-color: var(--gold);
}
.pcard.active {
  border-color: var(--gold) !important;
  box-shadow: 0 0 25px rgba(241, 218, 154, 0.35), 0 18px 40px -18px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .15) !important;
}

.pcard.ftth {
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(241, 218, 154, .25), transparent 55%),
    radial-gradient(90% 120% at 0% 100%, rgba(120, 40, 50, .45), transparent 60%),
    linear-gradient(135deg, #2A1622 0%, #10203A 55%, #1A2E52 100%);
}
.pcard .guilloche { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; pointer-events: none; }
.pcard > * { position: relative; }
.pcard .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pcard .brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pcard .emblem { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(241, 218, 154, .14); border: 1px solid rgba(241, 218, 154, .35); font-weight: 700; font-size: 13px; color: var(--gold-2); flex: none; overflow: hidden; }
.pcard .emblem img { width: 100%; height: 100%; object-fit: cover; }
.pcard .pname { font-weight: 600; font-size: 15px; }
.pcard .ptype { font-size: 11.5px; opacity: .7; }

.pcard-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.pcard-manage-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(241, 218, 154, 0.3);
  color: var(--gold-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}
.pcard-manage-btn:hover {
  background: rgba(241, 218, 154, 0.25);
  border-color: var(--gold);
  color: #FFF3D2;
  transform: scale(1.1);
}
.pcard-manage-btn svg {
  width: 16px;
  height: 16px;
}

.pcard .chipbar { width: 42px; height: 30px; border-radius: 7px; background: linear-gradient(135deg, #F7E3A8, #B98E36 60%, #F2D88E); box-shadow: inset 0 0 0 1px rgba(60, 40, 0, .35); flex: none; position: relative; }
.pcard .chipbar::before, .pcard .chipbar::after { content: ""; position: absolute; inset: 8px 4px; border-top: 1px solid rgba(60, 40, 0, .35); border-bottom: 1px solid rgba(60, 40, 0, .35); }
.pcard .chipbar::after { inset: 4px 14px; border: 0; border-inline: 1px solid rgba(60, 40, 0, .35); }
.pcard .bal-label { font-size: 12px; opacity: .7; }
.pcard .bal { font-size: 30px; font-weight: 600; letter-spacing: .5px; color: #FFF3D2; line-height: 1.2; }
.pcard .bal small { font-size: 14px; font-weight: 400; opacity: .8; margin-inline-start: 4px; }
.pcard .foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; font-size: 12px; }
.pcard .foot .user { opacity: .85; direction: ltr; }
.pcard .sync { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; background: rgba(0, 0, 0, .25); font-size: 11.5px; }
.pcard .sync i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.pcard .sync.err i { background: var(--bad); } .pcard .sync.busy i { background: var(--warn); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.pcard.all-card { background:
    radial-gradient(130% 140% at 100% 0%, rgba(241, 218, 154, .30), transparent 55%),
    linear-gradient(135deg, #1A2B47 0%, #0C1A2E 60%, #20385F 100%); }

.rail-dots { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 0 0 10px; }
.rail-dot-btn {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--line-2);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.rail-dot-btn:hover {
  background: var(--gold-2);
  transform: scale(1.2);
}
.rail-dot-btn.on {
  width: 26px;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(241, 218, 154, 0.5);
}

/* ---------- مربعات الإحصاء ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px 12px 10px;
  cursor: pointer; text-align: start; display: flex; flex-direction: column; gap: 10px; min-height: 104px; color: var(--text);
}
.tile .tl { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.tile .tl svg { width: 17px; height: 17px; }
.tile .tv { font-size: 26px; font-weight: 600; margin-top: auto; }
.tile.k-online .tl svg { color: var(--info); } .tile.k-active .tl svg { color: var(--ok); }
.tile.k-soon .tl svg { color: var(--warn); } .tile.k-expired .tl svg { color: var(--bad); }
.tile.k-offline .tl svg { color: #C98A5E; } .tile.k-all .tl svg { color: var(--gold-2); }
.tile.k-debt .tl svg { color: var(--gold-2); } .tile.k-weak .tl svg { color: #E57BB3; }
.tile:active { transform: scale(.98); }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.quick button { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.quick svg { width: 21px; height: 21px; color: var(--gold-2); }

.freshness { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--faint); margin: 12px 0 0; }
.freshness svg { width: 14px; height: 14px; }

/* ---------- المشتركون ---------- */
.search, .search-wrap, .noc-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.search > svg, .search-wrap > svg, .noc-search > svg {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 18px !important;
  height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  z-index: 2;
  flex: none;
}
.search .input, .search-wrap .input, .noc-search .input {
  width: 100%;
  padding-right: 42px !important;
  padding-left: 38px;
  min-height: 44px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
}
.search .input:focus, .noc-search .input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 20%, transparent);
}
.search-clear {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 0;
  background: var(--raised);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  z-index: 3;
}
.search-clear svg {
  width: 12px !important;
  height: 12px !important;
  position: static !important;
  transform: none !important;
  color: inherit !important;
}
.subs { display: flex; flex-direction: column; gap: 8px; }
.sub {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--r-m);
  background: var(--surface); border: 1px solid var(--line); cursor: pointer; color: var(--text);
}
.sub .days {
  width: 58px; min-height: 60px; border-radius: 13px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--info) 18%, var(--raised)); color: #CFE6FF; line-height: 1.15; text-align: center;
}
.sub .days b { font-size: 20px; font-weight: 600; }
.sub .days span { font-size: 10.5px; opacity: .85; }
.sub .days.soon { background: color-mix(in srgb, var(--warn) 22%, var(--raised)); color: #FFE2B5; }
.sub .days.exp { background: color-mix(in srgb, var(--bad) 18%, var(--raised)); color: #FFC9C9; }
.sub .days.off { background: var(--raised); color: var(--muted); }
.sub .nm { font-weight: 500; }
.sub-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sub-ip-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
  letter-spacing: 0.3px;
  flex: none;
  cursor: pointer;
  user-select: all;
  text-decoration: none !important;
  transition: all 0.15s ease;
}
.sub-ip-badge.online {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.28);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.12);
}
.sub-ip-badge:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.45);
}
.sub-ip-badge svg {
  opacity: 0.85;
  flex: none;
}
.sub .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12px; color: var(--muted); margin-top: 3px; }
.dotst { display: inline-flex; align-items: center; gap: 5px; }
.dotst i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.dotst.on i { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.debt-amt { color: var(--warn); font-weight: 500; }
.dep-amt { color: var(--ok); font-weight: 500; }
.loadmore { margin: 14px auto 0; display: flex; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; color: var(--faint); margin-bottom: 10px; }

/* ---------- صفحة المشترك ---------- */
.hero { text-align: center; padding: 18px 12px 16px; }
.hero .ring { width: 124px; height: 124px; margin: 0 auto 10px; position: relative; }
.hero .ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.hero .ring .c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hero .ring b { font-size: 30px; font-weight: 600; line-height: 1.1; }
.hero .ring span { font-size: 12px; color: var(--muted); }
.hero h2 { margin: 4px 0 2px; font-size: 20px; font-weight: 600; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: var(--r-m); overflow: hidden; border: 1px solid var(--line); }
.kv > div { background: var(--surface); padding: 10px 12px; }
.kv .k { font-size: 11.5px; color: var(--muted); }
.kv .v { font-weight: 500; word-break: break-word; }
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.actions button { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 4px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; color: var(--text); }
.actions button svg { width: 22px; height: 22px; color: var(--gold-2); }
.actions button.main { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--gold-ink); border-color: transparent; font-weight: 600; }
.actions button.main svg { color: var(--gold-ink); }
.balance-strip { display: flex; align-items: center; justify-content: space-between; padding: 14px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--surface); }
.balance-strip .amt { font-size: 22px; font-weight: 600; }
.balance-strip svg { width: 18px; height: 18px; color: #E57BB3; }
.ledger .item { cursor: default; }
.ledger .amt { font-weight: 600; }

/* ---------- الإحصائيات ---------- */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px 14px; }
.kpi .k { font-size: 12.5px; color: var(--muted); }
.kpi .v { font-size: 22px; font-weight: 600; margin-top: 4px; }
.kpi .v small { font-size: 12px; color: var(--muted); font-weight: 400; margin-inline-start: 4px; }
.chart { width: 100%; height: 190px; display: block; }
.chart text { fill: var(--faint); font-size: 10px; font-family: var(--font); }

/* ---------- نافذة منزلقة ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(3, 8, 16, .55); opacity: 0; transition: opacity .2s; }
.scrim.open { opacity: 1; }
.sheet {
  position: fixed; z-index: 61; inset-inline: 0; bottom: 0; max-height: 92vh; display: flex; flex-direction: column;
  background: var(--bg-2); border-radius: 24px 24px 0 0; border: 1px solid var(--line-2); border-bottom: 0;
  transform: translateY(100%); transition: transform .26s cubic-bezier(.2, .8, .2, 1);
  padding-bottom: env(safe-area-inset-bottom, 0px); width: 100%; margin: 0 auto;
}
.sheet.open { transform: none; }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 10px auto 4px; flex: none; }
.sheet .sh-head { display: flex; align-items: center; gap: 10px; padding: 6px 18px 10px; flex: none; }
.sheet .sh-head h2 { margin: 0; font-size: 18px; font-weight: 600; flex: 1; }
.sheet .sh-body { overflow-y: auto; padding: 0 16px 18px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.count-pill { min-width: 42px; height: 30px; padding: 0 10px; border-radius: 15px; background: var(--raised); display: grid; place-items: center; font-weight: 600; font-size: 14px; }

@media (min-width: 768px) {
  .sheet {
    top: 50%; bottom: auto; left: 50%; right: auto;
    width: 92%; max-width: 780px; max-height: 88vh;
    border-radius: 20px; border-bottom: 1px solid var(--line-2);
    transform: translate(-50%, -50%) scale(0.96);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
  }
  .sheet.open { transform: translate(-50%, -50%) scale(1); }
  .sheet .grab { display: none; }
}

@media (prefers-reduced-motion: reduce) { .sheet, .scrim, .switch i, .switch i::after { transition: none; } }

.toast {
  position: fixed; z-index: 90; left: 50%; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(20px); opacity: 0; transition: .25s; pointer-events: none;
  background: var(--raised); border: 1px solid var(--line-2); color: var(--text); padding: 11px 18px; border-radius: 14px;
  max-width: calc(100% - 32px); box-shadow: 0 12px 30px rgba(0, 0, 0, .35); font-size: 14px;
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.err { border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
.toast.okk { border-color: color-mix(in srgb, var(--ok) 50%, transparent); }

.banner { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; margin-bottom: 12px; font-size: 13.5px;
  background: color-mix(in srgb, var(--warn) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.banner.bad { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.banner.info { background: color-mix(in srgb, var(--info) 10%, var(--surface)); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.banner svg { width: 20px; height: 20px; flex: none; }

/* ---------- الدخول ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; }
.auth-hero { padding: 54px 24px 40px; position: relative; overflow: hidden; text-align: center;
  background: radial-gradient(90% 80% at 50% 0%, rgba(212, 175, 90, .22), transparent 70%), linear-gradient(180deg, #11284A, var(--bg)); }
.auth-hero .logo { width: 76px; height: 76px; margin: 0 auto 14px; }
.auth-hero h1 { margin: 0; font-size: 30px; font-weight: 600; letter-spacing: .5px; color: #FFF3D2; }
.auth-hero p { margin: 6px 0 0; color: var(--muted); }
.auth-body { flex: 1; width: 100%; max-width: 440px; margin: 0 auto; padding: 22px 20px 40px; }

.progress { height: 8px; border-radius: 4px; background: var(--raised); overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transition: width .4s; }

.company-grid { display: flex; flex-direction: column; gap: 8px; }
.company { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; transition: all .2s ease; }
.company:hover { border-color: rgba(212, 175, 90, 0.4); }
.company.on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 8%, var(--surface)); }
.company > svg { width: 20px; height: 20px; flex: none; color: var(--gold); }
.logo-box { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--raised); color: var(--gold-2); font-weight: 600; font-size: 13px; overflow: hidden; flex: none; }
.logo-box img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- كارت الشعار الرسمي في صفحة المزيد ---------- */
.more-brand-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 16px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(20, 39, 64, 0.9) 0%, rgba(15, 30, 50, 0.95) 100%);
  border: 1px solid rgba(212, 175, 90, 0.22);
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  margin-bottom: 12px;
  text-align: center;
  overflow: hidden;
}
.more-brand-badge-wrap {
  position: absolute;
  top: 12px;
  left: 14px;
}
.more-brand-logo {
  height: 100px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(0, 160, 230, 0.28));
  transition: transform 0.3s ease;
}
.more-brand-logo:hover {
  transform: scale(1.02);
}
.more-brand-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 8px;
  letter-spacing: 0.3px;
  font-weight: 500;
}
:root[data-theme="light"] .more-brand-hero {
  background: linear-gradient(180deg, #1b3352 0%, #112338 100%);
  border-color: rgba(212, 175, 90, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}
:root[data-theme="light"] .more-brand-sub {
  color: #a0aec0;
}

.var-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.var-chips button { border: 1px dashed var(--line-2); background: transparent; color: var(--gold-2); border-radius: 10px; padding: 4px 9px; font-size: 12px; cursor: pointer; }
.preview-bubble { background: color-mix(in srgb, var(--ok) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent); border-radius: 14px 14px 4px 14px; padding: 10px 12px; white-space: pre-wrap; font-size: 13.5px; }
.pair-code { font-size: 30px; letter-spacing: 6px; font-weight: 600; text-align: center; direction: ltr; color: var(--gold-2); padding: 14px; border: 1px dashed var(--gold); border-radius: 14px; margin: 8px 0; }
.meter { height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--ok); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: start; }
.tbl th { color: var(--muted); font-weight: 500; font-size: 12px; }
.tbl-wrap { overflow-x: auto; }
.tbl .input { min-height: 38px; padding: 6px 10px; border-radius: 10px; }
pre.code { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; overflow: auto; direction: ltr; text-align: left; font-size: 12px; max-height: 420px; white-space: pre-wrap; }

/* ---------- الطباعة (الوصل والتقارير) ---------- */
.print-only { display: none; }
@media print {
  @page { margin: 6mm; }
  body { background: #fff !important; color: #000 !important; }
  .no-print, .nav, .topbar, .toast { display: none !important; }
  .print-only { display: block; }
  .page { padding: 0 !important; max-width: none !important; }
}
.receipt { background: #fff; color: #000; margin: 0 auto; padding: 10px; font-family: Tahoma, var(--font); border-radius: 8px; }
.receipt h2 { text-align: center; margin: 0 0 2px; font-size: 1.25em; }
.receipt .c { text-align: center; }
.receipt hr { border: 0; border-top: 1px dashed #000; margin: 8px 0; }
.receipt .r { display: flex; justify-content: space-between; gap: 8px; margin: 3px 0; }
.receipt .big { font-size: 1.35em; font-weight: 700; }
.report { background: #fff; color: #000; padding: 16px; border-radius: 8px; overflow-x: auto; }
.report table { min-width: 640px; }
@media print { .report { overflow: visible; } .report table { min-width: 0; } }
.report table { width: 100%; border-collapse: collapse; font-size: 12px; }
.report th, .report td { border: 1px solid #999; padding: 4px 6px; text-align: start; }

/* ================= التجاوب مع كافة الشاشات والأجهزة (RESPONSIVE & MOBILE DESIGN) ================= */

/* 1. هواتف الموبايل (شاشات حتى 768px) */
@media (max-width: 768px) {
  input, select, textarea, .input {
    font-size: 16px !important; /* منع تقريب الشاشة الإجباري في هواتف iOS Safari */
  }
  .page {
    padding: 12px 12px calc(var(--nav-h) + 20px + env(safe-area-inset-bottom, 0px));
  }
  .topbar .in {
    padding: calc(6px + env(safe-area-inset-top, 0px)) 12px 6px;
    min-height: 50px;
    gap: 8px;
  }
  .topbar h1 {
    font-size: 15px !important;
    overflow: hidden;
  }
  .topbar-title-wrap {
    gap: 6px;
    font-size: 15px;
  }
  .topbar-title-wrap svg {
    width: 18px;
    height: 18px;
  }
  .topbar-actions {
    gap: 4px;
  }
  .topbar-actions .btn.sm {
    min-height: 36px;
    padding: 0 8px;
    font-size: 12px;
    border-radius: 10px;
  }
  .card {
    padding: 12px;
    border-radius: 14px;
  }
  .tiles {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .tile {
    min-height: 88px;
    padding: 10px;
  }
  .tile .tv {
    font-size: 22px;
  }
  .pcard {
    border-radius: 18px;
    padding: 14px 16px;
    min-height: 165px;
    flex: 0 0 100%;
  }
  /* توسيط الكارت تماماً: هامش متساوٍ في الجهتين، والكارت يملأ العرض الداخلي للشريط
     (نسبة flex-basis تُحسب من العرض الداخلي بعد الهامش، فـ 94% كانت تترك الفراغ كله في جهة واحدة) */
  .cards-rail {
    padding-inline: 12px;
    scroll-padding-inline: 12px;
  }
  .rail-nav-btn {
    display: none;
  }
  .pcard .bal {
    font-size: 24px;
  }
  .pcard .emblem {
    width: 34px;
    height: 34px;
  }
  .quick {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
  .quick button {
    font-size: 11px;
    padding: 8px 2px;
    border-radius: 11px;
  }
  .quick svg {
    width: 18px;
    height: 18px;
  }
  .actions {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .sub {
    padding: 10px;
    gap: 10px;
  }
  .sub .days {
    width: 50px;
    min-height: 52px;
  }
  .sub .days b {
    font-size: 17px;
  }
  .sub .nm {
    font-size: 14px;
  }
  .sub .meta {
    font-size: 11.5px;
    gap: 3px 8px;
  }
  .sub-ip-badge {
    font-size: 10px;
    padding: 1.5px 5px;
  }
}

/* 2. شاشات الأجهزة اللوحية والحواسيب (TABLET & DESKTOP: 769px+) */
@media (min-width: 769px) {
  .page {
    max-width: 860px;
    padding: 22px 24px calc(var(--nav-h) + 28px);
  }
  .page.wide {
    max-width: 1220px;
  }
  .topbar .in {
    max-width: 860px;
    padding: 12px 24px;
  }
  .page.wide ~ .topbar .in, .topbar.wide .in {
    max-width: 1220px;
  }
  .nav .in {
    max-width: 860px;
  }
  .tiles {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  .pcard {
    flex: 0 0 420px;
    opacity: 0.76;
    transform: scale(0.975);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .pcard:hover {
    opacity: 0.92;
    transform: scale(0.99);
  }
  .pcard.active {
    opacity: 1 !important;
    transform: scale(1) !important;
    border-color: var(--gold) !important;
    box-shadow: 0 0 25px rgba(241, 218, 154, 0.4), 0 20px 45px -15px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  }
  .noc-stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  .noc-devices-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}

/* 3. الشاشات الكبيرة ومحطات المراقبة (WIDESCREEN: 1180px+) */
@media (min-width: 1180px) {
  .page {
    max-width: 1120px;
  }
  .page.wide {
    max-width: 1420px;
  }
  .topbar .in {
    max-width: 1120px;
  }
  .page.wide ~ .topbar .in, .topbar.wide .in {
    max-width: 1420px;
  }
  .nav .in {
    max-width: 1120px;
  }
  .tiles {
    grid-template-columns: repeat(4, 1fr);
  }
  .noc-stats-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  .noc-devices-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .metrics-row {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* 4. جداول البيانات المتجاوبة باللمس */
.tbl-wrap, .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-m);
  border: 1px solid var(--line);
  scrollbar-width: thin;
  margin: 6px 0;
}
.tbl-wrap table.tbl, .table-wrap table.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 580px;
  font-size: 13px;
}
.data-table th, .data-table td, .tbl th, .tbl td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: start;
}
.data-table th, .tbl th {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  background: var(--bg-2);
}
.data-table tr:hover, .tbl tr:hover {
  background: color-mix(in srgb, var(--surface) 50%, transparent);
}

/* 5. وضع تطبيق الويب المثبت (PWA Standalone Mode) */
@media all and (display-mode: standalone) {
  .topbar .in {
    padding-top: max(14px, env(safe-area-inset-top, 0px));
  }
  .nav {
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }
  body {
    user-select: none;
    -webkit-user-select: none;
  }
  input, textarea {
    user-select: auto;
    -webkit-user-select: auto;
  }
}

/* أيقونات داخل النصوص الصغيرة */
.hint svg, p svg, .s svg { width: 1.1em; height: 1.1em; vertical-align: -0.2em; }

/* أيقونات مباشرة داخل صفوف القوائم */
.item > svg:not(.chev) { width: 20px; height: 20px; flex: none; color: var(--gold-2); }

/* ================= الأجهزة ================= */
.panelbar { display: flex; align-items: center; gap: 10px; margin: 2px 0 10px; }
.plusbtn { width: 46px; height: 46px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--surface); color: var(--gold-2); display: grid; place-items: center; cursor: pointer; flex: none; }
.plusbtn svg { width: 22px; height: 22px; }
.pillsel { min-height: 46px; padding: 0 16px; border-radius: 23px; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); background: color-mix(in srgb, var(--gold) 7%, var(--surface)); color: var(--gold-2); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 500; }
.pillsel svg.dn { width: 16px; height: 16px; transform: rotate(-90deg); }
.hero-art { width: 84px; height: 84px; border-radius: 26px; margin: 4px auto 14px; display: grid; place-items: center; background: radial-gradient(circle at 30% 25%, #2d4f82, #14263F); color: var(--gold-2); border: 1px solid var(--line-2); }
.hero-art svg { width: 38px; height: 38px; }

.tabs { margin-top: 2px; }
.chip img.mini { width: 22px; height: 18px; object-fit: contain; }
.chip svg { width: 16px; height: 16px; }
.redot { width: 7px; height: 7px; border-radius: 50%; background: var(--bad); display: inline-block; }
.devs { display: flex; flex-direction: column; gap: 10px; }
.dev { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.devimg { width: 84px; height: 64px; flex: none; border-radius: 14px; background: radial-gradient(circle at 30% 20%, #223c63, #14263F 70%); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.devimg img { width: 100%; height: 100%; object-fit: contain; }
.devimg.lg { width: 96px; height: 72px; } .devimg.xl { width: 128px; height: 96px; }
.dstat { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.dstat i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.dstat.up { color: var(--ok); } .dstat.up i { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.dstat.down { color: var(--bad); } .dstat.down i { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 22%, transparent); }
.dstat.big { font-size: 15px; font-weight: 600; }
.dsum { margin-top: 3px; } .dsum .ok, .num.ok { color: var(--ok); } .dsum .warn, .num.warn { color: var(--warn); } .dsum .bad, .num.bad { color: var(--bad); }
.devempty img { width: 190px; max-width: 70%; opacity: .55; margin-bottom: 4px; }
.floatbar { position: fixed; z-index: 25; inset-inline: 0; bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: center; pointer-events: none; }
.floatbar .btn { pointer-events: auto; min-width: 190px; box-shadow: 0 10px 28px rgba(0, 0, 0, .45); }
.devhero { display: flex; gap: 14px; align-items: center; }
.center { display: flex; justify-content: center; margin: 14px 0 6px; }
.btn.big { min-width: 200px; min-height: 54px; border-radius: 27px; font-size: 16px; }

.pingcard { padding: 16px; } .pingcard .pt { font-size: 22px; font-weight: 600; margin-bottom: 12px; direction: ltr; text-align: left; }
.pgrid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 14px; }
.pgrid .k { display: block; font-size: 11.5px; color: var(--muted); } .pgrid b { font-size: 18px; font-weight: 600; }
.bars { height: 120px; display: flex; align-items: flex-end; gap: 4px; padding: 4px 0; border-bottom: 2px solid var(--line-2); direction: ltr; }
.bars.tall { height: 96px; }
.bars i { flex: 1; min-width: 3px; height: 6%; border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--raised) 80%, #fff 6%); transition: height .25s; }
.bars i.g { background: var(--ok); } .bars i.y { background: var(--warn); } .bars i.r { background: var(--bad); } .bars i.lost { background: repeating-linear-gradient(45deg, var(--bad), var(--bad) 3px, transparent 3px, transparent 6px); border: 1px solid var(--bad); }

.ports { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; direction: ltr; }
.port { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px 2px; border-radius: 9px; background: var(--bg-2); border: 1px solid var(--line); font-size: 10.5px; color: var(--faint); }
.port i { width: 9px; height: 9px; border-radius: 3px; background: var(--faint); }
.port.up { color: var(--text); border-color: color-mix(in srgb, var(--ok) 40%, transparent); } .port.up i { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
details summary { list-style: none; } details summary::-webkit-details-marker { display: none; }

.banner.soft { background: color-mix(in srgb, var(--gold) 8%, var(--surface)); border-color: color-mix(in srgb, var(--gold) 28%, transparent); color: var(--text); }
.banner.soft b { color: var(--gold-2); }
.dstat.stale { color: var(--faint); } .dstat.stale i { background: var(--warn); }

/* ================= NOC CARRIER-GRADE NETWORK MODULE STYLES ================= */
.noc-page { padding-bottom: 80px; }
.noc-stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 14px; }
.stat-card { padding: 14px; position: relative; overflow: hidden; border-radius: 14px; }
.stat-hdr { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.stat-hdr svg { width: 17px !important; height: 17px !important; max-width: 17px !important; max-height: 17px !important; flex: none; }
.stat-val { font-size: 26px; font-weight: 700; line-height: 1.1; margin-bottom: 4px; }
.stat-sub { font-size: 11px; }

.pulse-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; position: relative; }
.pulse-dot.on { background: var(--ok); box-shadow: 0 0 10px var(--ok); animation: pulseGreen 2s infinite; }
.pulse-dot.off { background: var(--bad); box-shadow: 0 0 10px var(--bad); animation: pulseRed 2s infinite; }
@keyframes pulseGreen { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.2); } }
@keyframes pulseRed { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(1.2); } }

.noc-filter-bar { padding: 14px; margin-bottom: 16px; border-radius: 14px; }
.filter-controls-row { display: flex; gap: 10px; align-items: center; width: 100%; }
.filter-actions-row { display: flex; gap: 8px; align-items: center; flex: none; }
.vendor-select { min-width: 170px; }
.refresh-btn { flex: none; white-space: nowrap; }
.chips-scroll { display: flex; flex-direction: column; gap: 8px; }
.sep-line { height: 1px; background: var(--line); margin: 2px 0; }

.noc-devices-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.dev-card { padding: 16px; border-radius: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--card); border: 1px solid rgba(255, 255, 255, 0.08); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22); transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; position: relative; }
.dev-card:hover { transform: translateY(-3px); border-color: rgba(212, 175, 90, 0.35); box-shadow: 0 8px 26px rgba(0, 0, 0, 0.32); }
.dev-card.online { border-color: rgba(39, 201, 63, 0.22); }
.dev-card.online:hover { border-color: rgba(39, 201, 63, 0.45); box-shadow: 0 8px 28px rgba(39, 201, 63, 0.08); }
.dev-card.offline { border-color: rgba(231, 76, 60, 0.35); background: linear-gradient(180deg, rgba(231, 76, 60, 0.04) 0%, var(--card) 100%); }
.dev-card.maintenance { border-color: rgba(243, 156, 18, 0.35); }

.card-head { display: flex; gap: 12px; align-items: center; }
.dev-thumb { position: relative; width: 48px; height: 48px; min-width: 48px; border-radius: 12px; background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.01) 100%), var(--bg-2); border: 1px solid rgba(255, 255, 255, 0.1); display: grid; place-items: center; padding: 6px; box-shadow: inset 0 2px 6px rgba(0,0,0,0.3); }
.dev-thumb img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 5px rgba(0,0,0,0.35)); }
.status-indicator { position: absolute; bottom: -2px; right: -2px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--card); }
.status-indicator.online { background: #2ecc71; box-shadow: 0 0 8px #2ecc71; }
.status-indicator.offline { background: #ff5252; box-shadow: 0 0 8px #ff5252; }
.status-indicator.maintenance { background: #f39c12; box-shadow: 0 0 8px #f39c12; }

/* Status Pill (يعمل بالأخضر الزاهي / منقطع بالأحمر) */
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: 0.2px; white-space: nowrap; flex: none; }
.status-pill.status-online { background: rgba(39, 201, 63, 0.14); color: #2ecc71; border: 1px solid rgba(46, 204, 113, 0.38); box-shadow: 0 0 10px rgba(46, 204, 113, 0.14); }
.status-pill.status-offline { background: rgba(231, 76, 60, 0.14); color: #ff5252; border: 1px solid rgba(231, 76, 60, 0.38); box-shadow: 0 0 10px rgba(231, 76, 60, 0.14); }
.status-pill.status-maintenance { background: rgba(243, 156, 18, 0.14); color: #f39c12; border: 1px solid rgba(243, 156, 18, 0.38); }
.status-pill .pulse-indicator { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.status-pill.status-online .pulse-indicator { background: #2ecc71; box-shadow: 0 0 7px #2ecc71; animation: onlineGlow 2s infinite ease-in-out; }
.status-pill.status-offline .pulse-indicator { background: #ff5252; box-shadow: 0 0 7px #ff5252; }
.status-pill.status-maintenance .pulse-indicator { background: #f39c12; }
@keyframes onlineGlow { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.2); opacity: 0.7; } }

.dev-main-info { display: flex; flex-direction: column; gap: 5px; overflow: hidden; min-width: 0; }
.dev-name { font-size: 15px; font-weight: 700; color: #fff; line-height: 1.25; }
.dev-ip-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

/* Clickable IP Address Link */
.ip-link { font-size: 12px; color: var(--gold-2); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 6px; background: rgba(212, 175, 90, 0.08); border: 1px solid rgba(212, 175, 90, 0.22); transition: all 0.2s ease; cursor: pointer; }
.ip-link:hover { color: #fff; background: rgba(212, 175, 90, 0.24); border-color: rgba(212, 175, 90, 0.55); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(212, 175, 90, 0.15); }

.badge.cat-badge { background: rgba(52, 152, 219, 0.15); color: #5dade2; border-color: rgba(52, 152, 219, 0.3); font-size: 10px; }
.badge.group-badge { background: rgba(56, 189, 248, 0.14); color: #38bdf8; border-color: rgba(56, 189, 248, 0.32); font-size: 10px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.badge.group-badge .group-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex: none; }
.badge.vendor-badge { background: rgba(241, 196, 15, 0.15); color: #f4d03f; border-color: rgba(241, 196, 15, 0.3); font-size: 10px; }
.badge.model-badge { background: rgba(255, 255, 255, 0.05); color: #e2e8f0; border-color: rgba(255, 255, 255, 0.12); font-size: 10.5px; font-weight: 600; max-width: 140px; }
.badge.fw-badge { background: rgba(56, 189, 248, 0.08); color: #38bdf8; border-color: rgba(56, 189, 248, 0.2); font-family: monospace; font-size: 10px; }

/* Group chips & Action */
.group-chips-wrap { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px dashed rgba(255, 255, 255, 0.08); }
.group-chips-list { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
.group-chips-list::-webkit-scrollbar { display: none; }
/* صف المجموعات يتمرّر أفقياً داخل الشاشة بدل أن يمدّها (عناصر flex لا تضيق تلقائياً تحت عرض محتواها) */
.group-chips-wrap .group-row { flex: 1 1 100%; min-width: 0; flex-wrap: nowrap; }
.group-chips-wrap .group-row > span { flex: none; }
.group-chips-list { flex: 1 1 auto; min-width: 0; }
.group-chips-list .chip.group-chip { flex: none; white-space: nowrap; }
.noc-filter-bar { min-width: 0; max-width: 100%; }
.chip.group-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 4px 11px; border-radius: 20px; transition: all 0.2s ease; }
.chip.group-chip .g-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.chip.group-chip .g-count { font-size: 10px; opacity: 0.75; padding: 1px 5px; border-radius: 10px; background: rgba(255, 255, 255, 0.08); }
.chip.group-chip.on { background: rgba(56, 189, 248, 0.18); border-color: #38bdf8; color: #fff; box-shadow: 0 0 10px rgba(56, 189, 248, 0.2); }
.chip.group-chip.on .g-count { background: rgba(56, 189, 248, 0.3); color: #fff; }
.btn-manage-groups { font-size: 11.5px; padding: 4px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12); color: var(--gold-2); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; flex: none; cursor: pointer; transition: all 0.2s ease; }
.btn-manage-groups:hover { background: rgba(212, 175, 90, 0.15); border-color: var(--gold); color: #fff; transform: translateY(-1px); }

/* Dedicated Specs Strip */
.dev-specs-strip { display: flex; flex-direction: column; gap: 5px; padding: 7px 10px; border-radius: 9px; background: rgba(255, 255, 255, 0.025); border: 1px solid rgba(255, 255, 255, 0.05); font-size: 11px; }
.spec-ssid-row { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; padding-bottom: 5px; border-bottom: 1px dashed rgba(255, 255, 255, 0.06); }
.spec-ssid-row .ssid-icon { flex: none; color: #eab308; }
.spec-ssid-row .ssid-name { color: #fef08a; font-weight: 600; font-size: 11.5px; letter-spacing: 0.3px; word-break: break-word; white-space: normal; line-height: 1.35; }
.spec-meta-row { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; }
.spec-item { display: inline-flex; align-items: center; gap: 4px; color: #94a3b8; white-space: nowrap; }
.spec-item .k { color: #64748b; font-size: 10px; }
.spec-item b { color: #cbd5e1; font-weight: 600; }
.spec-item.freq b { color: #a5b4fc; }
.spec-item.uptime b { color: #38bdf8; }

.card-warn-box { padding: 6px 10px; border-radius: 8px; margin-top: 2px; line-height: 1.4; border: 1px solid transparent; font-size: 11.5px; }
.card-warn-box.bad { background: rgba(231, 76, 60, 0.1); border-color: rgba(231, 76, 60, 0.25); color: #ff6b6b; }
.card-warn-box.warn { background: rgba(243, 156, 18, 0.1); border-color: rgba(243, 156, 18, 0.25); color: #f39c12; }

/* Balanced 4-Column Metrics Row */
.metrics-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; background: rgba(8, 16, 28, 0.65); padding: 8px 6px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.05); text-align: center; }
.metric-col { display: flex; flex-direction: column; gap: 3px; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.025); border: 1px solid rgba(255, 255, 255, 0.04); border-radius: 8px; padding: 6px 3px; min-width: 0; }
.metric-col .k { font-size: 10px; color: #94a3b8; white-space: nowrap; font-weight: 500; }
.metric-col .v { font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.mini-bar { width: 100%; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: 2px; }
.mini-bar i { display: block; height: 100%; border-radius: 2px; }

.card-footer-btns { display: flex; gap: 6px; align-items: center; margin-top: 2px; }
.card-footer-btns .act-inspect { flex: 1; height: 38px; min-height: 38px; font-size: 13px; font-weight: 600; border-radius: 10px; }
.card-footer-btns .btn.icon-btn,
.card-footer-btns .btn:not(.act-inspect) { width: 38px; height: 38px; min-width: 38px; min-height: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); color: #cbd5e1; }
.card-footer-btns .btn.danger { color: #f87171; background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.18); }

/* Switch Port Matrix */
.switch-matrix-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; direction: ltr; margin: 12px 0; }
.port-socket { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 60px; border-radius: 8px; background: #0c1827; border: 1.5px solid #1c3148; cursor: pointer; position: relative; transition: all 0.15s; }
.port-socket:hover { border-color: var(--gold); transform: scale(1.04); }
.port-socket.selected { border-color: #fff; box-shadow: 0 0 8px rgba(255,255,255,0.4); }
.port-label { font-size: 10px; font-weight: 600; color: #8ea2be; }
.port-led { width: 8px; height: 8px; border-radius: 50%; background: #2a415a; }
.port-led.led-on { background: #2ecc71; box-shadow: 0 0 6px #2ecc71; }
.port-socket.eth-up { border-color: #27ae60; }
.port-socket.poe-on { border-color: #f39c12; }
.port-socket.sfp-up { border-color: #2980b9; background: #0a1f33; }
.sfp-tag, .poe-tag { position: absolute; font-size: 8px; font-weight: 700; top: 2px; left: 3px; padding: 1px 3px; border-radius: 3px; }
.sfp-tag { background: #2980b9; color: #fff; }
.poe-tag { background: #d35400; color: #fff; top: auto; bottom: 2px; }

.port-icon { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-inline-end: 4px; vertical-align: middle; }
.port-icon.up { background: #2ecc71; }
.port-icon.down { background: #7f8c8d; }
.port-icon.poe { background: #f39c12; }
.port-icon.sfp { background: #2980b9; }

/* ================= INTERACTIVE NETWORK TOPOLOGY EXPLORER (MATCHING REFERENCE IMAGE 1) ================= */
.topo-explorer-modal {
  display: flex;
  flex-direction: column;
  height: 88vh;
  min-height: 580px;
  background: #090e17;
  color: #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  font-family: inherit;
  position: relative;
}

/* 1. Header Bar */
.topo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: #0d1524;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 12px;
}
.topo-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.topo-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}
.topo-header-icon svg {
  width: 20px;
  height: 20px;
}
.topo-header-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.topo-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topo-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.2px;
}
.topo-live-pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.topo-live-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}
.topo-header-stats {
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  gap: 8px;
}
.topo-header-stats span {
  color: #cbd5e1;
}

/* Link Filter Toggle Group (Backbone vs All Mesh) */
.topo-link-filter-group {
  display: flex;
  background: rgba(15, 23, 42, 0.9);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  gap: 3px;
}
.topo-link-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.15s;
}
.topo-link-btn:hover {
  color: #cbd5e1;
}
.topo-link-btn.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(6, 95, 70, 0.3));
  color: #34d399;
  font-weight: 600;
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.topo-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topo-hdr-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  border-radius: 9px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.topo-hdr-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}
.topo-hdr-btn.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
  color: #38bdf8;
}
.topo-hdr-btn svg {
  width: 14px;
  height: 14px;
}
.topo-close-btn {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.18s ease;
  flex-shrink: 0;
}
.topo-close-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.45);
}
.topo-close-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  display: block;
}

/* 2. Top Filter and Layout Navigation Row */
.topo-subbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  background: #0b121f;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  gap: 12px;
  flex-wrap: wrap;
}
.topo-subbar::-webkit-scrollbar {
  height: 4px;
}
.topo-subbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}
.topo-search-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.topo-search-box {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}
.topo-search-box svg {
  position: absolute;
  right: 12px;
  width: 15px;
  height: 15px;
  color: #64748b;
  pointer-events: none;
}
.topo-search-box input {
  width: 100%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 7px 34px 7px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.15s;
}
.topo-search-box input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}
.topo-filter-select {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}
.topo-cluster-btn {
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #c4b5fd;
  border-radius: 9px;
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}
.topo-cluster-btn:hover, .topo-cluster-btn.active {
  background: rgba(139, 92, 246, 0.25);
  border-color: #a78bfa;
  color: #fff;
}

/* Layout Modes Navigation Tabs */
.topo-layout-nav {
  display: flex;
  background: rgba(15, 23, 42, 0.9);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  gap: 2px;
  flex-shrink: 0;
}
.topo-layout-tab {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.topo-layout-tab:hover {
  color: #cbd5e1;
}
.topo-layout-tab.active {
  background: #1e293b;
  color: #38bdf8;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* 3. Main Workspace: Canvas + Inspector Sidebar */
.topo-body-workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Canvas Container */
.topo-canvas-view {
  flex: 1;
  position: relative;
  background: #070d18;
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(20, 35, 60, 0.4) 0%, transparent 80%),
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 28px 28px, 28px 28px;
  overflow: hidden;
  display: flex;
  align-items: stretch;
}
.topo-canvas-svg {
  width: 100%;
  height: 100%;
  cursor: grab;
  user-select: none;
}
.topo-canvas-svg:active {
  cursor: grabbing;
}

/* Floating Hop Focus Filter Bar (Top of canvas) */
.topo-focus-bar {
  position: absolute;
  top: 14px;
  right: 18px;
  z-index: 10;
  display: flex;
  align-items: center;
  background: rgba(13, 21, 36, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  padding: 3px 8px;
  gap: 6px;
  font-size: 11.5px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.topo-focus-title {
  color: #94a3b8;
  font-weight: 500;
}
.topo-focus-pills {
  display: flex;
  gap: 3px;
}
.topo-focus-pill {
  background: transparent;
  border: none;
  color: #cbd5e1;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.12s;
}
.topo-focus-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.topo-focus-pill.active {
  background: #0284c7;
  color: #fff;
  font-weight: 600;
}
.topo-focus-clear {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 13px;
  line-height: 1;
}

/* Floating Navigation Controls (Relocated to bottom-left away from nodes) */
.topo-canvas-floating-ctrls {
  position: absolute;
  bottom: 20px;
  left: 20px;
  top: auto;
  z-index: 10;
  display: flex;
  flex-direction: column;
  background: rgba(13, 21, 36, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.topo-float-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.topo-float-btn:last-child {
  border-bottom: none;
}
.topo-float-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #38bdf8;
}
.topo-float-btn svg {
  width: 16px;
  height: 16px;
}

/* 4. Inspector Panel (فاحص العقد والروابط المنزلق الذكي) */
.topo-inspector-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 360px;
  max-width: 90vw;
  background: #0a101b;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: none;
  display: flex;
  flex-direction: column;
  z-index: 25;
  transform: translateX(105%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.6);
}
.topo-inspector-panel.open {
  transform: translateX(0);
}
.topo-insp-drag-handle {
  display: none;
}
.topo-insp-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.topo-insp-header-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #f1f5f9;
}
.topo-insp-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 13px;
  transition: all 0.15s;
}
.topo-insp-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}
.topo-inspector-empty {
  padding: 30px 20px;
  text-align: center;
  color: #64748b;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
}
.topo-inspector-empty svg {
  width: 36px;
  height: 36px;
  opacity: 0.35;
}

.topo-inspector-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.topo-insp-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.topo-insp-thumb {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  padding: 6px;
  flex: none;
}
.topo-insp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.topo-insp-titles {
  flex: 1;
  overflow: hidden;
}
.topo-insp-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topo-insp-ip {
  font-size: 12px;
  color: #38bdf8;
  font-family: monospace;
}
.topo-insp-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10.5px;
  font-weight: 600;
  margin-top: 4px;
}
.topo-insp-status-badge.online {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.topo-insp-status-badge.offline {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.topo-insp-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 10px;
}
.topo-insp-detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.topo-insp-detail-item .lbl {
  font-size: 10.5px;
  color: #64748b;
}
.topo-insp-detail-item .val {
  font-size: 12px;
  color: #cbd5e1;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topo-insp-section-title {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.topo-insp-links-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.topo-insp-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  font-size: 11.5px;
}
.topo-link-dest {
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}
.topo-link-dest-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}
.topo-link-meta {
  color: #64748b;
  font-size: 11px;
}

.topo-insp-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}
.topo-insp-btn-primary {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
  transition: opacity 0.15s;
}
.topo-insp-btn-primary:hover {
  opacity: 0.92;
}
.topo-insp-btn-danger {
  background: transparent;
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}
.topo-insp-btn-danger:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
}

/* 5. Mobile Responsiveness */
@media (max-width: 768px) {
  .topo-explorer-modal {
    height: 96vh;
    min-height: 480px;
    border-radius: 12px;
  }
  .topo-header {
    padding: 10px 12px;
    gap: 8px;
  }
  .topo-header-stats {
    font-size: 11px;
  }
  .topo-link-filter-group {
    width: 100%;
    order: 3;
    margin-top: 4px;
  }
  .topo-link-btn {
    flex: 1;
    justify-content: center;
    padding: 7px;
    font-size: 11.5px;
  }
  .topo-subbar {
    padding: 8px 12px;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .topo-layout-nav {
    width: 100%;
    display: flex;
    justify-content: space-between;
    overflow-x: auto;
  }
  .topo-layout-tab {
    flex: 1;
    text-align: center;
    font-size: 11px;
    padding: 6px 4px;
    white-space: nowrap;
  }
  .topo-search-filters {
    width: 100%;
    gap: 6px;
    flex-wrap: wrap;
  }
  .topo-search-box {
    flex: 1;
    min-width: 140px;
  }
  .topo-search-box input {
    min-width: 130px;
    font-size: 11.5px;
    padding: 6px 28px 6px 10px;
  }
  .topo-filter-select {
    font-size: 11px;
    padding: 6px 8px;
  }
  .topo-cluster-btn {
    font-size: 11px;
    padding: 6px 10px;
  }
  .topo-inspector-panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    max-height: 65vh;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.7);
    background: #0d1525;
    border-radius: 18px 18px 0 0;
    transform: translateY(105%);
  }
  .topo-inspector-panel.open {
    transform: translateY(0);
  }
  .topo-insp-drag-handle {
    display: block;
    width: 44px;
    height: 4.5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.25);
    margin: 10px auto 4px auto;
  }
  .topo-canvas-floating-ctrls {
    bottom: 14px;
    left: 14px;
  }
  .topo-float-btn {
    width: 38px;
    height: 38px;
    font-size: 14px;
  }
}

/* Ping live bars */
.ping-bars-box { height: 90px; display: flex; align-items: flex-end; gap: 3px; border-bottom: 2px solid var(--line); direction: ltr; margin-top: 10px; }
.ping-bars-box i { flex: 1; border-radius: 3px 3px 0 0; background: #233549; transition: height 0.2s; min-height: 4px; }
.ping-bars-box i.g { background: #2ecc71; }
.ping-bars-box i.y { background: #f1c40f; }
.ping-bars-box i.r { background: #e74c3c; }
.ping-bars-box i.lost { background: #c0392b; border: 1px dashed #e74c3c; }

/* ================= NOC MOBILE RESPONSIVE ADAPTATIONS (OVERRIDING BASE NOC) ================= */
@media (max-width: 768px) {
  .noc-stats-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
  }
  .stat-card {
    padding: 8px 10px !important;
    border-radius: 12px !important;
    min-height: 62px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
  }
  .stat-c-total {
    grid-column: span 2 !important;
  }
  .stat-c-online {
    grid-column: span 2 !important;
  }
  .stat-c-offline {
    grid-column: span 2 !important;
  }
  .stat-c-clients {
    grid-column: span 3 !important;
  }
  .stat-c-latency {
    grid-column: span 3 !important;
  }
  .stat-hdr {
    font-size: 10.5px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 4px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .stat-hdr svg {
    width: 14px !important;
    height: 14px !important;
    max-width: 14px !important;
    max-height: 14px !important;
    flex: none !important;
  }
  .stat-val {
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
    margin: 2px 0 !important;
  }
  .stat-val small {
    font-size: 10.5px !important;
    font-weight: 400 !important;
  }
  .stat-sub {
    font-size: 9.5px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    opacity: 0.75 !important;
  }
  .filter-controls-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  .filter-actions-row {
    display: flex !important;
    width: 100% !important;
    gap: 8px !important;
  }
  .filter-actions-row .vendor-select {
    flex: 1 !important;
    min-width: 0 !important;
  }
  .filter-actions-row .refresh-btn {
    flex: none !important;
  }
  .hide-mobile-sm {
    display: none !important;
  }
  .hide-mobile {
    display: none !important;
  }
  .noc-devices-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .dev-card {
    padding: 12px 14px !important;
    border-radius: 16px !important;
    gap: 10px !important;
  }
  .card-head {
    gap: 10px !important;
    align-items: center !important;
  }
  .dev-thumb {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    border-radius: 12px !important;
    padding: 5px !important;
  }
  .dev-name {
    font-size: 14.5px !important;
  }
  .dev-specs-strip {
    gap: 4px !important;
    padding: 6px 8px !important;
    font-size: 10.5px !important;
  }
  .spec-ssid-row {
    gap: 5px !important;
    padding-bottom: 4px !important;
  }
  .spec-ssid-row .ssid-name {
    font-size: 11px !important;
  }
  .spec-meta-row {
    gap: 4px 10px !important;
  }
  .metrics-row {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 5px !important;
    padding: 6px !important;
  }
  .metric-col {
    padding: 6px 2px !important;
    border-radius: 8px !important;
  }
  .metric-col .k {
    font-size: 9.5px !important;
  }
  .metric-col .v {
    font-size: 11.5px !important;
  }
  .card-footer-btns {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    margin-top: 2px !important;
  }
  .card-footer-btns .act-inspect {
    flex: 1 !important;
    height: 38px !important;
    min-height: 38px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    order: 0 !important;
    padding: 0 10px !important;
  }
  .card-footer-btns .btn.icon-btn,
  .card-footer-btns .btn:not(.act-inspect) {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 10px !important;
    flex: none !important;
  }
  .switch-matrix-grid {
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)) !important;
    gap: 5px !important;
  }
  .port-socket {
    height: 50px !important;
  }
  .port-label {
    font-size: 8.5px !important;
  }
  .port-led {
    width: 6px !important;
    height: 6px !important;
  }
  .sfp-tag, .poe-tag {
    font-size: 7px !important;
  }
  .topo-modal-shell {
    height: calc(90vh - 70px) !important;
    min-height: 360px !important;
  }
  .topo-toolbar {
    padding: 8px !important;
    gap: 6px !important;
  }
  .topo-toolbar .btn {
    min-height: 34px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
  }
}

/* ================= ADD DEVICE MODAL (MATCHING SPEC & SCREENSHOT) ================= */
.dev-modal-head-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dev-modal-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.dev-modal-icon-badge svg {
  width: 22px !important;
  height: 22px !important;
}
.dev-modal-head-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dev-modal-head-text .title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.dev-modal-head-text .subtitle {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: normal;
}

.dev-modal-preview {
  background: rgba(14, 25, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dev-modal-preview-main {
  display: flex;
  align-items: center;
  gap: 14px;
}
.dev-thumb-preview {
  width: 58px;
  height: 58px;
  min-width: 58px;
  border-radius: 12px;
  background: rgba(8, 16, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  padding: 8px;
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.4);
}
.dev-thumb-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}
.dev-preview-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow: hidden;
}
.dev-preview-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dev-preview-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.dev-preview-hint {
  font-size: 11.5px;
  color: #7dd3fc;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.form-split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 560px) {
  .form-split-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

.field-label-req {
  font-size: 12px;
  font-weight: 500;
  color: #cbd5e1;
}
.field-hdr-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.btn-link-action {
  background: none;
  border: none;
  padding: 0;
  color: #38bdf8;
  font-size: 11.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
}
.btn-link-action:hover {
  color: #7dd3fc;
  text-decoration: underline;
}
.btn-link-action svg {
  width: 13px !important;
  height: 13px !important;
}

.model-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.model-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.model-chip:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  transform: translateY(-1px);
}
.model-chip.active {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #fff;
  font-weight: 600;
}

.field-note {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 5px;
  line-height: 1.4;
}

.big-submit-btn {
  min-height: 48px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  margin-top: 8px;
  box-shadow: 0 4px 16px rgba(241, 218, 154, 0.2);
}




/* ===== 4.5.0 — عرض مخصص لكل نوع جهاز ===== */
.role-tag { margin-bottom: 8px; }
.role-tag span { display: inline-block; font-size: 12.5px; color: var(--gold-2, var(--gold)); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); border-radius: 12px; padding: 2px 10px; }
.issue-banner { margin-bottom: 10px; border-width: 1px; }
.issue-banner.bad { border-color: var(--bad); }
.issue-banner.warn { border-color: var(--warn); }
.issue-banner ul { margin: 6px 0 0; padding: 0 18px 0 0; }
.issue-banner li.bad { color: var(--bad); } .issue-banner li.warn { color: var(--warn); }
#roleHero { margin-bottom: 12px; }
#roleHero > .card { margin-bottom: 10px; }
.sigmeter .sm-lbl { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; font-size: 18px; }
.sm-bar { height: 8px; background: var(--line); border-radius: 6px; overflow: hidden; direction: ltr; }
.sm-bar i { display: block; height: 100%; border-radius: 6px; }
.distbar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; gap: 2px; direction: ltr; }
.distbar i { display: block; min-width: 0; } .distbar .g { background: var(--ok); } .distbar .y { background: var(--warn); } .distbar .r { background: var(--bad); }
.topports .tp-row { display: grid; grid-template-columns: 70px 1fr auto; gap: 8px; align-items: center; padding: 3px 0; }
.tp-bar { height: 7px; background: var(--line); border-radius: 5px; overflow: hidden; direction: ltr; } .tp-bar i { display: block; height: 100%; background: var(--gold); border-radius: 5px; }
.tp-v { direction: ltr; color: var(--muted); }
/* المتصلون */
.cl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; }
.cl-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m, 12px); padding: 12px; display: flex; flex-direction: column; gap: 9px; }
.cl-card.weakc { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); }
.cl-top { display: flex; align-items: center; gap: 10px; }
.cl-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.cl-name { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-type { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--line); color: var(--muted); flex: none; }
.cl-type.pppoe { color: var(--gold); } .cl-type.wireless { color: var(--ok); }
.cl-sig { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; }
.cl-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.cl-stats > div { display: flex; flex-direction: column; font-size: 13px; } .cl-stats .k { font-size: 11px; color: var(--muted); }
.cl-ids { display: flex; flex-wrap: wrap; gap: 6px; direction: ltr; }
.cl-ids .cp { background: transparent; border: 1px dashed var(--line-2, var(--line)); color: var(--muted); border-radius: 8px; padding: 2px 8px; cursor: pointer; font-size: 11.5px; }
/* المشاكل والتنبيهات */
.prob-panel { margin-bottom: 14px; border-radius: 14px; transition: all 0.25s ease; border: 1px solid var(--line); }
.prob-panel.bad { border-color: rgba(231, 76, 60, 0.4); background: linear-gradient(180deg, rgba(231, 76, 60, 0.05) 0%, var(--card) 100%); }
.prob-panel.warn { border-color: rgba(243, 156, 18, 0.4); background: linear-gradient(180deg, rgba(243, 156, 18, 0.05) 0%, var(--card) 100%); }
.prob-panel.ok { padding: 12px 16px; border-color: rgba(39, 201, 63, 0.3); }
.prob-panel.collapsed { padding: 10px 14px; }
.prob-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.prob-dot.bad { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.prob-dot.warn { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.btn-close-prob { transition: all 0.2s ease; border-radius: 6px; }
.btn-close-prob:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.prob-list { display: grid; gap: 6px; }
.prob-item { display: flex; gap: 10px; align-items: center; text-align: right; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: pointer; color: inherit; font: inherit; transition: background 0.15s, border-color 0.15s; }
.prob-item:hover { background: rgba(255, 255, 255, 0.04); border-color: rgba(212, 175, 90, 0.3); }
.prob-item i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.prob-item.bad i { background: var(--bad); box-shadow: 0 0 6px var(--bad); }
.prob-item.warn i { background: var(--warn); box-shadow: 0 0 6px var(--warn); }
.prob-item .pn { font-weight: 600; flex: none; color: #fff; }
.prob-item .pt { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.kpi .v.num, .cl-sig .num, .sm-lbl .num { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ==================== LIVE TRAFFIC COMPONENT ==================== */
.live-traffic-card {
  margin-bottom: 12px;
  background: linear-gradient(180deg, rgba(20, 39, 64, 0.95) 0%, rgba(15, 30, 50, 0.98) 100%);
  border: 1px solid rgba(160, 190, 230, 0.16);
  border-radius: var(--r-m);
  padding: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22);
  position: relative;
  overflow: hidden;
}

.lt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.lt-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lt-icon-glow {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(0, 210, 255, 0.12);
  border: 1px solid rgba(0, 210, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00e5ff;
  box-shadow: 0 0 14px rgba(0, 210, 255, 0.2);
}

.lt-main-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.lt-en-title {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(212, 175, 90, 0.14);
  color: var(--gold);
  border: 1px solid rgba(212, 175, 90, 0.25);
  letter-spacing: 0.3px;
}

.lt-sub-title {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.lt-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.lt-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(60, 196, 143, 0.12);
  border: 1px solid rgba(60, 196, 143, 0.3);
  color: #3cc48f;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s ease;
  flex: none;
}

.lt-live-indicator.paused {
  background: rgba(142, 162, 190, 0.1);
  border-color: rgba(142, 162, 190, 0.25);
  color: var(--muted);
}

.lt-pulse-core {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: #3cc48f;
  box-shadow: 0 0 8px #3cc48f;
  animation: ltPulse 1.8s infinite ease-in-out;
}

@keyframes ltPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

.lt-select {
  width: auto;
  min-width: 105px;
  max-width: 135px;
  font-size: 11px;
  height: 28px;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line-2);
}

.lt-btn-pause {
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.lt-meters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0 12px;
}

@media (max-width: 540px) {
  .lt-meters-grid {
    grid-template-columns: 1fr;
  }
}

.lt-meter-box {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(15, 30, 50, 0.7);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.lt-meter-box.dl {
  border-color: rgba(0, 210, 255, 0.25);
  box-shadow: inset 0 0 20px rgba(0, 210, 255, 0.04), 0 4px 14px rgba(0, 0, 0, 0.15);
}

.lt-meter-box.ul {
  border-color: rgba(212, 175, 90, 0.25);
  box-shadow: inset 0 0 20px rgba(212, 175, 90, 0.04), 0 4px 14px rgba(0, 0, 0, 0.15);
}

.lt-meter-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.lt-arrow-chip {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.lt-arrow-chip.dl {
  background: rgba(0, 210, 255, 0.15);
  color: #00e5ff;
}

.lt-arrow-chip.ul {
  background: rgba(212, 175, 90, 0.15);
  color: var(--gold);
}

.lt-meter-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.lt-speed-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
  direction: ltr;
  unicode-bidi: isolate;
}

.lt-speed-num {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.lt-meter-box.dl .lt-speed-num {
  color: #00e5ff;
  text-shadow: 0 0 16px rgba(0, 229, 255, 0.28);
}

.lt-meter-box.ul .lt-speed-num {
  color: var(--gold-2, var(--gold));
  text-shadow: 0 0 16px rgba(212, 175, 90, 0.28);
}

.lt-speed-unit {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.lt-meter-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lt-meter-sub b {
  color: var(--text);
}

.lt-dot-sep {
  opacity: 0.4;
}

.lt-chart-wrapper {
  background: rgba(8, 18, 32, 0.85);
  border: 1px solid rgba(160, 190, 230, 0.12);
  border-radius: 14px;
  padding: 12px 14px 10px;
  position: relative;
}

.lt-chart-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.lt-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11.5px;
}

.lt-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.lt-legend-item.dl {
  color: #00e5ff;
}

.lt-legend-item.ul {
  color: var(--gold);
}

.lt-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.lt-legend-dot.dl {
  background: #00e5ff;
  box-shadow: 0 0 6px #00e5ff;
}

.lt-legend-dot.ul {
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
}

.lt-chart-time-label {
  font-size: 11px;
  color: var(--muted);
}

.lt-svg-container {
  width: 100%;
  height: 150px;
  overflow: hidden;
}

.lt-svg-chart {
  width: 100%;
  height: 100%;
  display: block;
}

.lt-ifaces-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.lt-iface-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s ease;
}

.lt-iface-chip:hover {
  border-color: var(--line-2);
  transform: translateY(-1px);
}

.lt-iface-chip.active {
  background: rgba(212, 175, 90, 0.12);
  border-color: var(--gold);
}

.lt-ic-name {
  font-weight: 600;
  color: var(--text);
}

.lt-ic-rate.dl {
  color: #00e5ff;
}

.lt-ic-rate.ul {
  color: var(--gold);
}

/* ================= نانو المشترك (Subscriber CPE & Signal) ================= */
.cpe-sig-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  margin-inline-start: 6px;
  vertical-align: middle;
}

.cpe-sig-badge svg {
  flex-shrink: 0;
}

.sig-good {
  background: rgba(34, 197, 94, 0.15) !important;
  color: #22c55e !important;
  border: 1px solid rgba(34, 197, 94, 0.3) !important;
}

.sig-mid {
  background: rgba(234, 179, 8, 0.15) !important;
  color: #eab308 !important;
  border: 1px solid rgba(234, 179, 8, 0.3) !important;
}

.sig-bad {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

.cpe-banner {
  padding: 16px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(212, 175, 90, 0.25);
  border-radius: 14px;
}

.cpe-banner-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cpe-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(212, 175, 90, 0.15);
  color: var(--gold-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cpe-icon-wrap svg {
  width: 24px;
  height: 24px;
}

.cpe-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.cpe-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.45;
}

.cpe-stats-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  flex-wrap: wrap;
}

.cpe-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* بوكس شفاف لقوة الإشارة وقراءة LAN على يسار المشترك */
.sub-cpe-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 11px;
  min-width: 66px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  flex: none;
  text-align: center;
  line-height: 1.25;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  margin-inline-start: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.sub-cpe-box:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}

.cpe-sig-val {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-num, inherit);
  color: #f1f5f9;
  letter-spacing: -0.3px;
  direction: ltr;
}

.cpe-sig-val.sig-good-val {
  color: #4ade80;
}

.cpe-sig-val.sig-mid-val {
  color: #facc15;
}

.cpe-sig-val.sig-bad-val {
  color: #f87171;
}

.sub-cpe-lan {
  font-size: 10.5px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.5px;
  margin-top: 3px;
  direction: ltr;
  text-transform: uppercase;
}

.sub-cpe-lan.lan-bad-val {
  color: #ef4444 !important;
  font-weight: 800;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.45);
}

.sub-cpe-box.lan-warn-box {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.15);
}

.sub-cpe-box.lan-warn-box:hover {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.65);
}

.balance-strip.lan-strip-alert {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
}
.balance-strip.lan-strip-alert:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.5);
}





/* ---------- بطاقة المحطة المتصلة (السيكتر) ---------- */
.st-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m, 12px); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.st-card.weak { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); }
.st-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.st-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.st-title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.st-name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.st-name.linked { color: var(--gold); }
.st-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: right; }
.st-signal { background: var(--bg-2, rgba(0,0,0,.15)); border-radius: 10px; padding: 9px 11px; display: flex; flex-direction: column; gap: 7px; }
.st-sig-main { display: flex; align-items: baseline; gap: 6px; }
.st-sig-main b { font-size: 22px; line-height: 1; direction: ltr; unicode-bidi: isolate; }
.st-unit { font-size: 12px; color: var(--muted); }
.st-q { margin-inline-start: auto; font-size: 13px; font-weight: 600; }
.st-sig-sub { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.st-sig-sub:empty { display: none; }
.st-sig-sub b { color: var(--text); font-weight: 600; direction: ltr; unicode-bidi: isolate; }
.st-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.st-stat { background: var(--bg-2, rgba(0,0,0,.12)); border-radius: 9px; padding: 7px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-stat .k { font-size: 11px; color: var(--muted); }
.st-stat b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: ltr; unicode-bidi: isolate; text-align: right; }
.st-ids { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 9px; }
.st-ids:empty { display: none; }
.st-id { display: flex; align-items: center; gap: 8px; font-size: 12.5px; min-width: 0; }
.st-id .k { width: 30px; flex: none; color: var(--muted); font-size: 11px; font-weight: 600; }
.st-id .v { direction: ltr; unicode-bidi: isolate; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-vend { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.st-id .cp { margin-inline-start: auto; background: transparent; border: 1px solid var(--line-2, var(--line)); color: var(--muted); border-radius: 7px; padding: 2px 9px; cursor: pointer; font-size: 11px; text-decoration: none; flex: none; }
.st-id .cp + .cp { margin-inline-start: 0; }
.st-id .cp:hover { color: var(--gold); border-color: var(--gold); }
.st-warn { font-size: 12px; color: var(--warn); }
.st-qual { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; font-size: 12px; }
.st-qual .k { color: var(--muted); }
.st-qual b { font-size: 13px; direction: ltr; unicode-bidi: isolate; }
.st-stats:empty { display: none; }
.lt-msg { margin: 0 0 12px; padding: 9px 12px; border-radius: 10px; font-size: 12.5px; background: color-mix(in srgb, var(--gold) 10%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); color: var(--text); }
.lt-msg.bad { background: color-mix(in srgb, var(--bad) 10%, transparent); border-color: color-mix(in srgb, var(--bad) 45%, transparent); color: var(--bad); }

/* ---------- التذاكر (منصة وكيل المشروع الوطني) ---------- */
.tk-tabs { margin-bottom: 12px; }
.tk-tabs button { font-size: 13.5px; padding: 0 6px; }
.tk-filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.tk-search { position: relative; }
.tk-chips .chip svg { width: 16px; height: 16px; }
.tk-meta { margin: 4px 4px 10px; min-height: 18px; }
.tk-meta b { color: var(--text); }
.tk-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.tk-wide { grid-column: 1 / -1; }
.tk-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; cursor: pointer; transition: border-color .15s, transform .15s; min-width: 0; }
.tk-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.tk-card.open { border-inline-start: 3px solid var(--ok); }
.tk-card.closed { border-inline-start: 3px solid var(--line-2); }
.tk-top { padding: 14px 14px 10px; display: flex; flex-direction: column; gap: 8px; }
.tk-title { font-weight: 700; font-size: 15.5px; overflow-wrap: anywhere; }
.tk-sum { color: var(--muted); font-size: 13px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tk-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tk-id b { font-size: 13px; overflow-wrap: anywhere; }
.tk-cp { width: 30px; height: 30px; margin-inline-start: auto; }
.tk-cp svg { width: 16px; height: 16px; }
.tk-bottom { margin-top: auto; background: var(--bg-2); border-top: 1px solid var(--line); padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; }
.tk-dates, .tk-people { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tk-dates div, .tk-people div, .tk-zone { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tk-people b { overflow-wrap: anywhere; font-weight: 600; }
.tk-zone { flex-direction: row; gap: 8px; align-items: center; }
.tk-skel { min-height: 210px; cursor: default; background: linear-gradient(90deg, var(--surface) 25%, var(--raised) 50%, var(--surface) 75%); background-size: 200% 100%; animation: tkShimmer 1.2s infinite linear; }
@keyframes tkShimmer { to { background-position: -200% 0; } }
.tk-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 16px 0 4px; }
.tk-pager .btn svg { width: 18px; height: 18px; }
.tk-dhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.tk-dsum { color: var(--muted); line-height: 1.8; margin: 0 0 10px; overflow-wrap: anywhere; }
.tk-details { white-space: pre-wrap; line-height: 1.8; overflow-wrap: anywhere; margin-bottom: 10px; }
.tk-dgrid { display: grid; grid-template-columns: 1fr; gap: 0; padding: 4px 14px; }
.tk-drow { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.tk-drow:last-child { border-bottom: 0; }
.tk-drow b { text-align: end; overflow-wrap: anywhere; font-weight: 600; }
.tk-comments { display: flex; flex-direction: column; gap: 8px; }
.tk-comment { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface); }
.tk-ctext { white-space: pre-wrap; line-height: 1.8; overflow-wrap: anywhere; }
.tk-cmeta { margin-top: 6px; }
@media (min-width: 640px) {
  .tk-grid { grid-template-columns: repeat(2, 1fr); }
  .tk-filters { flex-direction: row; align-items: center; }
  .tk-filters .tk-search { flex: 1; min-width: 220px; }
  .tk-chips { padding-bottom: 2px; }
}
@media (min-width: 1000px) {
  .tk-grid { grid-template-columns: repeat(3, 1fr); }
  .tk-filters { flex-wrap: wrap; }
}
@media (max-width: 330px) {
  .tk-tabs button { font-size: 12.5px; }
  .tk-dates, .tk-people { grid-template-columns: 1fr; }
}

/* تنبيهات التذاكر */
.tk-alerts { padding: 0; margin: 0 0 12px; overflow: hidden; }
.tk-al-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; }
.tk-al-head::-webkit-details-marker { display: none; }
.tk-al-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--raised); color: var(--muted); flex: none; }
.tk-al-ic.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.tk-al-ic svg { width: 20px; height: 20px; }
.tk-al-t { font-weight: 700; }
.tk-bad { color: var(--bad); }
.tk-al-body { padding: 0 14px 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.tk-al-actions { gap: 8px; flex-wrap: wrap; }
.tk-al-actions .btn svg { width: 18px; height: 18px; }
.tk-al-set { margin-top: 12px; border-top: 1px solid var(--line); }
.tk-al-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.tk-al-row:last-child { border-bottom: 0; }
.tk-al-row > span { white-space: nowrap; }
.tk-al-row .tk-al-sel { width: auto; flex: 0 0 auto; min-width: 130px; max-width: 60%; min-height: 38px; padding-block: 0; }
.nav a .nav-badge { position: absolute; top: 4px; inset-inline-start: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
@media (max-width: 420px) { .tk-al-head .badge { display: none; } }
.sub-cpe-box.ont-wait { opacity: .55; }
.sub-cpe-box.ont-wait .cpe-sig-val { animation: tkShimmerTxt 1.2s infinite ease-in-out; }
@keyframes tkShimmerTxt { 50% { opacity: .35; } }

/* تأكيد رقم الهاتف عند إنشاء الحساب */
.linkbtn { background: none; border: 0; padding: 4px 2px; color: var(--gold-2); cursor: pointer; font: inherit; }
.linkbtn:disabled { color: var(--faint); cursor: default; }
.otp-input { font-size: 24px; letter-spacing: 10px; text-align: center; font-weight: 700; }

/* ================= حركة تشويق الميزة القادمة — كارت "حسابي" (دورة 15 ثانية) =================
   0-2ث لمعة وشفق · 2-3ث شارة "قريباً" بارتجاج · 3-5ث اسم الميزة حرفاً حرفاً · 5-7ث الوصف
   7-12ث مدارات ورادار وشرارات وشريط تقدم يعدّ إلى 87% وتوهج الشريحة · 13-15ث تلاشٍ وومضة ثم تعيد */
@property --tzp { syntax: '<integer>'; inherits: false; initial-value: 0; }
@property --tzh { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.tz-card { container-type: inline-size; }
.tz-card > :not(.tz) { z-index: 1; }
.pcard .tz { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; border-radius: inherit; }
.tz > * { position: absolute; }

/* شفق متحرك يتنفس */
.tz-aurora { inset: -40%; background: conic-gradient(from var(--tzh) at 30% 55%, rgba(241,218,154,0) 0deg, rgba(241,218,154,.22) 60deg, rgba(64,140,255,.20) 140deg, rgba(160,90,255,.14) 220deg, rgba(241,218,154,0) 300deg);
  filter: blur(40px); animation: tzHue 15s linear infinite, tzAurora 15s ease-in-out infinite; mix-blend-mode: screen; }
@keyframes tzHue { to { --tzh: 360deg; } }
@keyframes tzAurora { 0% { opacity: 0; transform: scale(.9); } 10% { opacity: .55; } 50% { opacity: 1; transform: scale(1.08); } 88% { opacity: .8; } 100% { opacity: 0; transform: scale(.95); } }

/* شبكة منظور تنزلق */
.tz-grid { left: 0; right: 0; bottom: -10%; height: 70%; opacity: 0;
  background: linear-gradient(rgba(241,218,154,.18) 1px, transparent 1px) 0 0 / 100% 22px, linear-gradient(90deg, rgba(241,218,154,.14) 1px, transparent 1px) 0 0 / 34px 100%;
  transform: perspective(380px) rotateX(62deg); transform-origin: bottom; -webkit-mask: linear-gradient(to top, #000 10%, transparent 90%); mask: linear-gradient(to top, #000 10%, transparent 90%);
  animation: tzGrid 15s linear infinite; }
@keyframes tzGrid { 0% { opacity: 0; background-position: 0 0, 0 0; } 12% { opacity: .55; } 85% { opacity: .45; } 95%, 100% { opacity: 0; background-position: 0 220px, 0 0; } }

/* لمعة قطرية تمر على الكارت */
.tz-sweep { top: -50%; bottom: -50%; width: 38%; left: -60%; transform: skewX(-22deg);
  background: linear-gradient(90deg, transparent, rgba(255,240,200,.08) 30%, rgba(255,246,220,.55) 50%, rgba(255,240,200,.08) 70%, transparent); filter: blur(2px);
  animation: tzSweep 15s cubic-bezier(.7,0,.2,1) infinite; }
@keyframes tzSweep { 0% { left: -60%; opacity: 0; } 2% { opacity: 1; } 13% { left: 130%; opacity: 1; } 14%, 100% { left: 130%; opacity: 0; } }

/* مدارات + رادار + أقمار */
.tz-orbit { width: min(52cqw, 92%); aspect-ratio: 1; left: 30cqw; top: 50%; transform: translate(-50%, -50%) scale(.6); opacity: 0; overflow: visible;
  animation: tzOrbitIn 15s cubic-bezier(.2,.8,.2,1) infinite; }
@keyframes tzOrbitIn { 0%, 36% { opacity: 0; transform: translate(-50%, -50%) scale(.55) rotate(-30deg); } 46% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); } 86% { opacity: .9; transform: translate(-50%, -50%) scale(1.04) rotate(8deg); } 94%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.25) rotate(14deg); } }
.tz-ring { fill: none; stroke: rgba(241,218,154,.28); stroke-width: .8; stroke-dasharray: 3 5; transform-origin: 100px 100px; }
.tz-ring.r1 { animation: tzSpin 14s linear infinite; }
.tz-ring.r2 { stroke: rgba(120,180,255,.25); stroke-dasharray: 1 6; animation: tzSpin 22s linear infinite reverse; }
.tz-ring.r3 { stroke: rgba(241,218,154,.16); stroke-dasharray: 10 8; animation: tzSpin 30s linear infinite; }
.tz-radar { transform-origin: 100px 100px; animation: tzSpin 4s linear infinite; opacity: .55; }
.tz-sat { transform-origin: 100px 100px; fill: #FFE7A3; filter: drop-shadow(0 0 4px #FFD36B); }
.tz-sat.s1 { animation: tzSpin 5s linear infinite; }
.tz-sat.s2 { animation: tzSpin 8s linear infinite reverse; }
.tz-sat.s3 { animation: tzSpin 12s linear infinite; fill: #9CC7FF; filter: drop-shadow(0 0 4px #6FA8FF); }
.tz-core { animation: tzCore 2.4s ease-in-out infinite; transform-origin: 100px 100px; }
@keyframes tzSpin { to { transform: rotate(360deg); } }
@keyframes tzCore { 50% { transform: scale(1.35); opacity: .6; } }

/* شرارات صاعدة */
.tz-sparks { left: 4cqw; width: 52cqw; top: 0; bottom: 0; opacity: 0; animation: tzGate 15s linear infinite; }
@keyframes tzGate { 0%, 44% { opacity: 0; } 50% { opacity: 1; } 86% { opacity: 1; } 92%, 100% { opacity: 0; } }
.tz-sparks i { position: absolute; bottom: -6px; left: var(--x); width: 3px; height: 3px; border-radius: 50%; background: #FFE7A3; box-shadow: 0 0 6px 1px rgba(255,211,107,.8);
  transform: scale(var(--s)); animation: tzSpark 3.4s linear var(--d) infinite; }
@keyframes tzSpark { 0% { transform: translate(0, 0) scale(var(--s)); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(14px, -26cqw) scale(0); opacity: 0; } }

/* النصوص */
.tz-copy { left: 5cqw; width: 50cqw; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: max(5px, .9cqw); text-align: center; }
.tz-badge { display: inline-flex; align-items: center; gap: 6px; padding: max(2px, .35cqw) max(9px, 1.1cqw); border-radius: 30px; font-size: max(10px, 1.25cqw); font-weight: 700; letter-spacing: .5px;
  color: #1B1405; background: linear-gradient(135deg, #FFF0C4, #E2B65A 55%, #FFE6A0); box-shadow: 0 0 18px rgba(241,218,154,.55); opacity: 0; animation: tzGlitch 15s steps(1, end) infinite, tzBadgeIn 15s ease-out infinite; }
.tz-badge b { width: 6px; height: 6px; border-radius: 50%; background: #B4232C; box-shadow: 0 0 0 0 rgba(180,35,44,.6); animation: tzLive 1.2s ease-out infinite; }
@keyframes tzLive { 70% { box-shadow: 0 0 0 6px rgba(180,35,44,0); } 100% { box-shadow: 0 0 0 0 rgba(180,35,44,0); } }
@keyframes tzBadgeIn { 0%, 13% { opacity: 0; transform: translateY(-8px) scale(.8); } 15% { opacity: 1; transform: translateY(0) scale(1.08); } 18% { transform: scale(1); } 87% { opacity: 1; filter: blur(0); } 93%, 100% { opacity: 0; transform: translateY(-6px) scale(.9); filter: blur(4px); } }
/* ارتجاج (glitch) لحظة الظهور */
@keyframes tzGlitch { 0%, 15% { clip-path: none; translate: 0; } 15.5% { clip-path: inset(0 0 55% 0); translate: -4px 0; } 16% { clip-path: inset(45% 0 0 0); translate: 4px 0; } 16.5% { clip-path: inset(20% 0 30% 0); translate: -2px 0; } 17%, 100% { clip-path: none; translate: 0; } }

.tz-title { font-size: max(16px, 4.1cqw); font-weight: 800; line-height: 1.15; white-space: nowrap; max-width: 100%; filter: drop-shadow(0 0 14px rgba(241,218,154,.35)); }
.tz-title span { display: inline-block; opacity: 0;
  background: linear-gradient(100deg, #C9963C 0%, #FFF4CF 40%, #F1DA9A 55%, #B9862F 100%); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: tzLetter 15s cubic-bezier(.2,.9,.25,1.2) calc(var(--i) * 160ms) infinite, tzShine 3s linear infinite; }
@keyframes tzLetter { 0%, 20% { opacity: 0; transform: translateY(.6em) rotateX(80deg) scale(.6); filter: blur(6px); } 26% { opacity: 1; transform: none; filter: blur(0); } 86% { opacity: 1; transform: none; filter: blur(0); } 92%, 100% { opacity: 0; transform: translateY(-.4em) scale(1.1); filter: blur(8px); } }
@keyframes tzShine { from { background-position: 150% 0; } to { background-position: -150% 0; } }

.tz-text { font-size: max(10.5px, 1.45cqw); color: rgba(246,235,203,.82); line-height: 1.6; max-width: 46cqw; opacity: 0; animation: tzText 15s ease-out infinite; }
@keyframes tzText { 0%, 33% { opacity: 0; transform: translateY(10px); filter: blur(4px); } 40% { opacity: 1; transform: none; filter: blur(0); } 86% { opacity: 1; filter: blur(0); } 92%, 100% { opacity: 0; filter: blur(6px); } }

/* شريط "جاري التجهيز" يعدّ حتى 87% */
.tz-bar { position: relative; width: min(30cqw, 90%); height: max(5px, .6cqw); border-radius: 10px; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(241,218,154,.18); margin: max(3px, .4cqw) 0 max(14px, 1.6cqw); opacity: 0; animation: tzBarIn 15s ease-out infinite; }
.tz-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, #6FA8FF, #F1DA9A 60%, #FFF4CF); box-shadow: 0 0 12px rgba(241,218,154,.7); animation: tzFill 15s cubic-bezier(.3,.7,.2,1) infinite; }
.tz-fill::after { content: ""; position: absolute; right: -3px; top: 50%; width: 8px; height: 8px; border-radius: 50%; background: #FFF4CF; transform: translateY(-50%); box-shadow: 0 0 10px 3px rgba(255,236,170,.9); }
.tz-pct { position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%); font-size: max(9.5px, 1.05cqw); color: rgba(246,235,203,.7); white-space: nowrap; direction: ltr;
  counter-reset: p var(--tzp); animation: tzCount 15s cubic-bezier(.3,.7,.2,1) infinite; }
.tz-pct::before { content: "LOADING · " counter(p) "%"; letter-spacing: 1px; }
@keyframes tzBarIn { 0%, 44% { opacity: 0; transform: scaleX(.4); } 48% { opacity: 1; transform: none; } 86% { opacity: 1; } 92%, 100% { opacity: 0; } }
@keyframes tzFill { 0%, 48% { width: 0; } 80%, 100% { width: 87%; } }
@keyframes tzCount { 0%, 48% { --tzp: 0; } 80%, 100% { --tzp: 87; } }

/* توهج الشريحة وإطار الكارت */
.tz-card .chipbar { animation: tzChip 15s ease-in-out infinite; }
@keyframes tzChip { 0%, 44% { box-shadow: inset 0 0 0 1px rgba(60,40,0,.35); } 52%, 80% { box-shadow: inset 0 0 0 1px rgba(60,40,0,.35), 0 0 18px 4px rgba(255,214,120,.55); } 90%, 100% { box-shadow: inset 0 0 0 1px rgba(60,40,0,.35); } }
.pcard.tz-card { animation: tzBorder 15s ease-in-out infinite; }
@keyframes tzBorder { 0%, 100% { border-color: transparent; } 20%, 80% { border-color: rgba(241,218,154,.35); box-shadow: 0 18px 40px -18px rgba(0,0,0,.65), 0 0 30px -6px rgba(241,218,154,.35), inset 0 1px 0 rgba(255,255,255,.06); } }

/* ومضة الختام */
.tz-flash { inset: 0; background: radial-gradient(60% 80% at 30% 50%, rgba(255,244,207,.55), transparent 70%); opacity: 0; animation: tzFlash 15s ease-out infinite; }
@keyframes tzFlash { 0%, 90% { opacity: 0; } 93% { opacity: 1; } 100% { opacity: 0; } }

/* حركة الكارت تعمل دائماً — حتى مع إعداد "تقليل الحركة" (بطلب صاحب المنصة) */


/* ===== ضوء أصفر يسري على خطوط نقشة الكروت (نفس مسارات SVG) =====
   الحركة SVG مدمجة (<animate> على stroke-dashoffset) بطول كل خط المحسوب في guilloche() — تعمل في Safari/iPhone أيضاً.
   طبقتان: هالة عريضة خافتة + نواة أرفع وأسطع ⇒ أطراف ناعمة بدون فلاتر ثقيلة. */
.guilloche .g-beam { fill: none; stroke-linecap: round; }
.guilloche .g-beam.halo { stroke: rgba(255, 221, 60, .16); stroke-width: 2.6; }
.guilloche .g-beam.core { stroke: #FFE15A; stroke-width: 1.1; }
.pcard .guilloche .g-beams { mix-blend-mode: screen; }

.tk-panel { align-self: flex-start; font-size: 11px; }
.tk-panel svg { width: 13px; height: 13px; }

/* تواصل معنا */
.sp-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.sp-cats .chip svg { width: 16px; height: 16px; }
.sp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sp-thread { display: flex; flex-direction: column; gap: 10px; max-height: 52vh; overflow-y: auto; padding: 4px 2px; }
.sp-msg { max-width: 88%; border-radius: 14px; padding: 10px 12px; border: 1px solid var(--line); background: var(--surface); }
.sp-msg.agent { align-self: flex-start; }
.sp-msg.admin { align-self: flex-end; background: color-mix(in srgb, var(--gold) 10%, var(--surface)); border-color: color-mix(in srgb, var(--gold) 35%, transparent); }
.sp-who { color: var(--gold-2); font-weight: 600; display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.sp-who svg { width: 14px; height: 14px; }
.sp-body { white-space: pre-wrap; line-height: 1.8; overflow-wrap: anywhere; }
.sp-time { margin-top: 4px; }
.sp-reply { margin-top: 12px; }
.sp-reply .btn svg { width: 18px; height: 18px; }

/* VPN الأجهزة */
.vpn-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--raised); color: var(--muted); flex: none; }
.vpn-ic svg { width: 22px; height: 22px; }
.vpn-ic.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.vpn-ic.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.vpn-ic.bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.vpn-title { font-weight: 700; }
.vpn-fixed { display: flex; align-items: center; min-height: 46px; color: var(--text); background: var(--bg-2); cursor: default; }
.scan-progress { padding: 14px 4px; }
.scan-progress .sm-bar { margin-top: 8px; height: 6px; }
.scan-indet { animation: tkShimmerTxt 1.2s infinite ease-in-out; }
