/* ==== مدار كلاود — طابع غرفة السيرفرات ==== */

@font-face {
  font-family: 'Cairo';
  src: url('fonts/cairo.woff2') format('woff2');
  font-weight: 200 900;
  font-display: swap;
}

:root {
  --bg:      #05080f;
  --bg-2:    #080d18;
  --card:    #0b1322;
  --card-2:  #0e1830;
  --line:    #1a2a47;
  --line-2:  #24375c;
  --text:    #dce8ff;
  --dim:     #7e90b5;
  --cyan:    #38e1ff;
  --green:   #3dffa0;
  --amber:   #ffc857;
  --red:     #ff5d73;
  --violet:  #977bff;
  --mono:    'Cascadia Mono', ui-monospace, 'Courier New', monospace;
  --radius:  14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { color-scheme: dark; }

body {
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  background-image:
    radial-gradient(1100px 500px at 85% -10%, rgba(56,225,255,.07), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(151,123,255,.06), transparent 60%),
    linear-gradient(rgba(56,225,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56,225,255,.035) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
}

/* plaintext يجبر الأرقام واللاتيني على الترتيب الصحيح داخل سياق RTL
   دون تغيير محاذاة العنصر نفسه */
.mono { font-family: var(--mono); unicode-bidi: plaintext; }
.dim  { color: var(--dim); font-weight: 400; }
.hidden { display: none !important; }

/* ==== LED ==== */
.led {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #22314f;
}
.led.green  { background: var(--green);  box-shadow: 0 0 6px var(--green); }
.led.cyan   { background: var(--cyan);   box-shadow: 0 0 6px var(--cyan); }
.led.amber  { background: var(--amber);  box-shadow: 0 0 6px var(--amber); }
.led.red    { background: var(--red);    box-shadow: 0 0 6px var(--red); }
.led.blink  { animation: ledBlink 1.6s infinite; }
@keyframes ledBlink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* ==== وحدة راك (البطاقة الأساسية) ==== */
.unit {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(120, 160, 255, .07);
  overflow: hidden;
  position: relative;
}
.unit::before, .unit::after { /* براغي الراك */
  content: ''; position: absolute; top: 12px; width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #4a5d85, #131c30 70%);
  box-shadow: inset 0 0 2px #000;
  z-index: 2;
}
.unit::before { right: 10px; }
.unit::after  { left: 10px; }

.unit-head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 18, 36, .6);
  min-height: 44px;
}
.unit-title { font-weight: 700; font-size: 14px; white-space: nowrap; }
.unit-actions { display: flex; gap: 8px; align-items: center; margin-inline-start: auto; }
.leds { display: flex; gap: 6px; align-items: center; }

.vents { /* فتحات تهوية */
  margin-inline-start: auto;
  width: 70px; height: 14px; opacity: .5;
  background: repeating-linear-gradient(90deg, var(--line-2) 0 3px, transparent 3px 8px);
  border-radius: 2px;
}
.unit-actions + .vents, .leds + .vents { margin-inline-start: auto; }

.unit-body { padding: 16px 20px; }

/* ==== الهيكل العام ==== */
.shell { display: flex; min-height: 100vh; }

.side {
  width: 232px; flex-shrink: 0;
  display: flex; flex-direction: column;
  border-inline-end: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  padding: 18px 14px;
  position: sticky; top: 0; height: 100vh;
}
.side-brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 18px; }
.logo-svg { width: 42px; height: 42px; color: var(--cyan); filter: drop-shadow(0 0 8px rgba(56,225,255,.5)); }
.brand-name { font-weight: 800; font-size: 17px; }
.brand-sub { font-size: 10.5px; color: var(--dim); letter-spacing: .5px; }

.side-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; border-radius: 10px;
  color: var(--dim); text-decoration: none; font-weight: 600; font-size: 14.5px;
  border: 1px solid transparent;
  transition: .15s;
}
.nav-item svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.nav-item:hover { color: var(--text); background: rgba(56,225,255,.05); }
.nav-item.active {
  color: var(--cyan);
  background: linear-gradient(90deg, rgba(56,225,255,.12), rgba(56,225,255,.03));
  border-color: rgba(56,225,255,.25);
  box-shadow: inset 3px 0 0 var(--cyan);
}

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 7px; }
.pw-btn {
  display: flex; align-items: center; gap: 10px; justify-content: flex-start;
  padding: 10px 13px; border-radius: 10px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line);
  color: var(--dim); font-family: inherit; font-weight: 600; font-size: 13.5px;
  text-decoration: none; transition: .15s;
}
.pw-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.pw-btn:hover { color: var(--amber); border-color: var(--amber); }
.pw-btn.danger:hover { color: var(--red); border-color: var(--red); }
.pw-btn.ghost:hover { color: var(--text); border-color: var(--line-2); }

.main { flex: 1; padding: 18px 24px 40px; max-width: 1500px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 2px 16px;
}
.top-title { font-size: 21px; font-weight: 800; }
.top-status { display: flex; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--card); border: 1px solid var(--line); border-radius: 99px;
  padding: 6px 13px; font-size: 12.5px; color: var(--dim);
}

/* ==== العدادات الدائرية ==== */
.gauges {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px;
}
.gauge-card { padding: 18px 10px 14px; text-align: center; }
.gauge-wrap { position: relative; width: 116px; margin: 0 auto; }
.gauge-wrap svg { width: 116px; height: 116px; transform: rotate(-90deg); }
.g-bg  { fill: none; stroke: #16223c; stroke-width: 9; }
.g-val {
  fill: none; stroke-width: 9; stroke-linecap: round;
  stroke-dasharray: 289; stroke-dashoffset: 289;
  transition: stroke-dashoffset .6s ease, stroke .4s;
}
.c-cyan   { stroke: var(--cyan);   filter: drop-shadow(0 0 5px rgba(56,225,255,.6)); }
.c-green  { stroke: var(--green);  filter: drop-shadow(0 0 5px rgba(61,255,160,.55)); }
.c-amber  { stroke: var(--amber);  filter: drop-shadow(0 0 5px rgba(255,200,87,.55)); }
.c-violet { stroke: var(--violet); filter: drop-shadow(0 0 5px rgba(151,123,255,.55)); }
.c-red    { stroke: var(--red);    filter: drop-shadow(0 0 5px rgba(255,93,115,.6)); }
.g-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 2px;
}
.g-num b { font-family: var(--mono); font-size: 25px; font-weight: 700; }
.g-num i { font-style: normal; color: var(--dim); font-size: 12px; margin-top: 10px; }
.g-label { margin-top: 8px; font-weight: 700; font-size: 13.5px; }
.g-label .mono { font-size: 11px; display: block; margin-top: 2px; }

/* ==== الشبكات ==== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }

.kv {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 2px; border-bottom: 1px dashed rgba(36,55,92,.6); font-size: 13.5px;
}
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--dim); }
/* القيم تخلط عربي ولاتيني — plaintext يترك كل قيمة تحدد اتجاهها بنفسها */
.kv b { font-weight: 600; text-align: left; unicode-bidi: plaintext; }

.net-nums { display: flex; gap: 10px; margin-bottom: 12px; }
.net-pill {
  flex: 1; display: flex; justify-content: space-between; align-items: center;
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 13px; font-size: 12.5px;
}
.net-pill span { color: var(--dim); }
.net-pill.dl b { color: var(--cyan); }
.net-pill.ul b { color: var(--violet); }
#netChart { width: 100%; display: block; }

/* ==== أشرطة LED المقطعية للأقراص ==== */
.dbar { margin-bottom: 14px; }
.dbar:last-child { margin-bottom: 0; }
.dbar-top {
  display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 6px;
}
.dbar-top .mono { color: var(--dim); font-size: 11.5px; }
.segbar { display: flex; gap: 3px; direction: ltr; }
.segbar i {
  flex: 1; height: 12px; border-radius: 2px; background: #142038;
  box-shadow: inset 0 0 3px rgba(0,0,0,.5);
}
.segbar i.on       { background: var(--green); box-shadow: 0 0 5px rgba(61,255,160,.45); }
.segbar i.on.warn  { background: var(--amber); box-shadow: 0 0 5px rgba(255,200,87,.45); }
.segbar i.on.crit  { background: var(--red);   box-shadow: 0 0 5px rgba(255,93,115,.5); }

/* ==== الأقراص الفعلية ==== */
.drive {
  display: flex; align-items: center; gap: 16px;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 16px; margin-bottom: 10px;
  background: rgba(8, 14, 28, .5);
}
.drive:last-child { margin-bottom: 0; }
.drive-icon {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #14213c, #0b1322);
  border: 1px solid var(--line-2); color: var(--cyan);
}
.drive-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.drive-info { flex: 1; min-width: 0; }
.drive-name { font-weight: 700; font-size: 14px; }
.drive-meta { color: var(--dim); font-size: 11.5px; margin-top: 2px; }
.drive-size { font-family: var(--mono); font-size: 13px; color: var(--text); unicode-bidi: plaintext; }

/* ==== الجداول ==== */
.table-wrap { padding: 0; overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: right; color: var(--dim); font-weight: 600; font-size: 11.5px;
  padding: 10px 16px; border-bottom: 1px solid var(--line);
  background: rgba(10, 17, 34, .5); white-space: nowrap;
}
.tbl td { padding: 10px 16px; border-bottom: 1px solid rgba(26,42,71,.5); white-space: nowrap; }
.tbl tbody tr { cursor: pointer; transition: background .12s; }
.tbl tbody tr:hover { background: rgba(56,225,255,.05); }
.tbl tbody tr:last-child td { border-bottom: 0; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 99px; padding: 3px 11px; font-size: 11.5px; font-weight: 700;
}
.badge.ok   { background: rgba(61,255,160,.1);  color: var(--green); border: 1px solid rgba(61,255,160,.3); }
.badge.off  { background: rgba(126,144,181,.1); color: var(--dim);   border: 1px solid rgba(126,144,181,.25); }
.badge.bad  { background: rgba(255,93,115,.12); color: var(--red);   border: 1px solid rgba(255,93,115,.35); }
.badge.warn { background: rgba(255,200,87,.1);  color: var(--amber); border: 1px solid rgba(255,200,87,.3); }

/* ==== الأزرار ==== */
.btn {
  font-family: inherit; font-weight: 700; font-size: 13px;
  background: var(--card-2); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 9px;
  padding: 8px 16px; cursor: pointer; transition: .15s;
}
.btn:hover { border-color: var(--cyan); color: var(--cyan); }
.btn.sm { padding: 5px 12px; font-size: 12px; }
.btn.cyan   { background: rgba(56,225,255,.12); border-color: rgba(56,225,255,.4); color: var(--cyan); }
.btn.cyan:hover { background: rgba(56,225,255,.2); }
.btn.green  { background: rgba(61,255,160,.1); border-color: rgba(61,255,160,.35); color: var(--green); }
.btn.amber  { background: rgba(255,200,87,.1); border-color: rgba(255,200,87,.35); color: var(--amber); }
.btn.red    { background: rgba(255,93,115,.1); border-color: rgba(255,93,115,.4); color: var(--red); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.search {
  font-family: inherit; background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 6px 13px; font-size: 12.5px; width: 190px;
}
.search:focus { outline: none; border-color: var(--cyan); }

/* ==== فتات الملفات ==== */
.crumbs {
  direction: ltr; text-align: left;
  padding: 9px 20px; font-size: 12.5px; color: var(--dim);
  border-bottom: 1px solid var(--line); background: rgba(6, 11, 22, .5);
  overflow-x: auto; white-space: nowrap;
}
.crumbs a { color: var(--cyan); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { color: var(--line-2); margin: 0 2px; }

.f-ico { margin-inline-end: 8px; }
.f-name { font-weight: 600; }
td.ltr { direction: ltr; text-align: right; font-family: var(--mono); font-size: 12px; color: var(--dim); }

/* ==== متصفح الملفات ==== */
.fbar {
  display: flex; align-items: center; gap: 6px;
  border-bottom: 1px solid var(--line); background: rgba(6, 11, 22, .5);
  padding-inline-start: 10px;
}
.fbar .crumbs { flex: 1; border-bottom: 0; background: none; }
.fnav {
  flex: none; width: 28px; height: 28px; line-height: 1;
  background: var(--card-2); color: var(--dim);
  border: 1px solid var(--line-2); border-radius: 8px;
  font-size: 14px; cursor: pointer; transition: .15s;
}
.fnav:hover { color: var(--cyan); border-color: var(--cyan); }

/* أعمدة ثابتة العرض: الاسم يتمدد وحده كي لا ترقص بقية الأعمدة بين المجلدات */
.ftbl { table-layout: fixed; min-width: 860px; }
.ftbl th:nth-child(1), .ftbl td:nth-child(1) { width: auto; }
.ftbl th:nth-child(2), .ftbl td:nth-child(2) { width: 105px; }
.ftbl th:nth-child(3), .ftbl td:nth-child(3) { width: 90px; }
.ftbl th:nth-child(4), .ftbl td:nth-child(4) { width: 118px; }
.ftbl th:nth-child(5), .ftbl td:nth-child(5) { width: 150px; }
.ftbl th:nth-child(6), .ftbl td:nth-child(6) { width: 145px; }

.ftbl td { overflow: hidden; text-overflow: ellipsis; }
.ftbl .f-txt { unicode-bidi: plaintext; }
.ftbl .f-link { color: var(--dim); font-size: 11px; margin-inline-start: 8px; }
.ftbl td.num { text-align: left; direction: ltr; }
.ftbl td.perm { font-size: 11.5px; color: var(--dim); letter-spacing: .5px; }

.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--text); }
.tbl th.sortable::after { content: '↕'; opacity: .3; margin-inline-start: 5px; font-size: 10px; }
.tbl th.sortable.on { color: var(--cyan); }
.tbl th.sortable.on[data-dir="asc"]::after  { content: '↑'; opacity: 1; }
.tbl th.sortable.on[data-dir="desc"]::after { content: '↓'; opacity: 1; }

.fstat {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  padding: 10px 20px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--text); background: rgba(6, 11, 22, .5);
}
.fstat span:last-child { margin-inline-start: auto; }

/* ==== ملخص الخدمات ==== */
.svc-summary {
  display: flex; gap: 10px; padding: 12px 20px 0;
  flex-wrap: wrap;
}

/* ==== المودال ==== */
.modal-back {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(2, 5, 12, .75); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal { width: 560px; max-width: 96vw; max-height: 88vh; display: flex; flex-direction: column; }
.modal-x {
  margin-inline-start: auto; background: none; border: 0; color: var(--dim);
  font-size: 15px; cursor: pointer; padding: 4px 8px;
}
.modal-x:hover { color: var(--red); }
.modal-body { padding: 18px 20px; overflow-y: auto; font-size: 13.5px; }
.modal-body pre {
  direction: ltr; text-align: left; font-family: var(--mono); font-size: 11.5px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all;
  color: #a8c0e8; line-height: 1.7;
}
.modal-body .kv b { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.modal-body input[type=text], .modal-body textarea {
  width: 100%; font-family: inherit; background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 9px; padding: 10px 13px; font-size: 13.5px;
}
.modal-body textarea {
  font-family: var(--mono); font-size: 12.5px; min-height: 320px;
  direction: ltr; text-align: left; line-height: 1.6; resize: vertical;
}
.modal-body input:focus, .modal-body textarea:focus { outline: none; border-color: var(--cyan); }
.modal-foot {
  display: flex; gap: 8px; justify-content: flex-start;
  padding: 13px 20px; border-top: 1px solid var(--line);
}
.modal-foot:empty { display: none; }

/* ==== التنبيه ==== */
.toast {
  position: fixed; bottom: 24px; right: 50%; transform: translateX(50%);
  background: var(--card-2); border: 1px solid var(--cyan); color: var(--text);
  border-radius: 11px; padding: 11px 22px; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 14px rgba(56,225,255,.15);
  z-index: 60;
}
.toast.err { border-color: var(--red); }

.empty { color: var(--dim); text-align: center; padding: 26px 10px; font-size: 13px; }

/* ==== التحليل الزمني ==== */
.metric-card { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.metric-card:hover { border-color: var(--line-2); box-shadow: 0 0 0 1px rgba(56,225,255,.12); }
.metric-card:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.g-more { color: var(--dim); font-size: 10.5px; margin-top: 7px; opacity: 0; transition: opacity .15s; }
.metric-card:hover .g-more, .metric-card:focus-visible .g-more { opacity: 1; }

.mt-tabs, .mt-ranges { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; }
.mt-ranges { margin-bottom: 16px; }
.mt-tabs .btn.on, .mt-ranges .btn.on {
  border-color: var(--cyan); color: var(--cyan); background: rgba(56,225,255,.12);
}

/* شريط المدى في الجدول: يُظهر تفاوت القيمة داخل الفترة بنظرة */
.mt-range-bar { position: relative; height: 6px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.mt-range-bar i {
  position: absolute; top: 0; height: 100%;
  background: linear-gradient(90deg, rgba(61,255,160,.8), rgba(255,93,115,.8));
  border-radius: 4px;
}
.chart-legend i.dimlg { background: var(--line-2); }

/* ==== صفحة قاعدة واحدة ==== */
.db-back { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.db-back .mono { font-size: 11.5px; unicode-bidi: plaintext; }
.tbl tbody tr.row-on { background: rgba(56,225,255,.07); box-shadow: inset 2px 0 0 var(--cyan); }

/* ==== بطاقة الطرف الآخر ==== */
.peer-card { margin-bottom: 14px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.peer-card:hover { border-color: var(--line-2); box-shadow: 0 0 0 1px rgba(56,225,255,.12); }
.peer-card:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.peer-body { padding-bottom: 10px; }

.peer-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px 14px;
}
.peer-stat {
  display: flex; flex-direction: column; gap: 3px;
  background: rgba(6, 11, 22, .5); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px;
}
.peer-stat span { color: var(--dim); font-size: 11.5px; }
.peer-stat b { font-size: 15px; font-weight: 700; }
.peer-stat b.ok  { color: var(--green); }
.peer-stat b.bad { color: var(--red); }

.peer-svcs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.peer-down { text-align: center; padding: 14px 10px; }
.peer-down-t { color: var(--red); font-size: 19px; font-weight: 800; margin-bottom: 6px; }
.peer-down-s { color: var(--dim); font-size: 12px; margin-top: 3px; }

.peer-foot {
  padding: 9px 20px; border-top: 1px solid var(--line);
  color: var(--dim); font-size: 11.5px; background: rgba(6, 11, 22, .5);
}

/* ==== سجل الطرف الآخر ==== */
.seg-btns { display: flex; gap: 6px; }
.seg-btns .btn.on { border-color: var(--cyan); color: var(--cyan); background: rgba(56,225,255,.12); }

/* شريط التوفر: شريحة لكل فحص، تُقرأ كخط زمني واحد */
.uptime-bar {
  display: flex; gap: 1px; direction: ltr;
  height: 26px; margin-bottom: 14px; border-radius: 6px; overflow: hidden;
}
.uptime-bar i { flex: 1 1 0; min-width: 1px; background: var(--green); opacity: .75; }
.uptime-bar i.down { background: var(--red); opacity: 1; }
.uptime-bar i:hover { opacity: 1; }

.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 11.5px; color: var(--dim); }
.chart-legend i.lg { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-inline-end: 5px; vertical-align: middle; }
.chart-legend i.cyan { background: var(--cyan); }
.chart-legend i.violet { background: var(--violet); }
.chart-legend i.amber { background: var(--amber); }
.chart-legend i.red { background: var(--red); }

.dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-inline-end: 4px; background: var(--line-2);
}
.dot.on  { background: var(--green); box-shadow: 0 0 5px rgba(61,255,160,.5); }
.dot.off { background: var(--red);   box-shadow: 0 0 5px rgba(255,93,115,.5); }

@media (max-width: 1180px) {
  .peer-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==== النسخ الاحتياطية ==== */
.bk-cards {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-bottom: 14px;
}
.bk-card { padding: 16px 18px 14px; }
.bk-card-t { color: var(--dim); font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.bk-card-v { font-size: 22px; font-weight: 800; min-height: 30px; }
.bk-card-s { color: var(--dim); font-size: 11.5px; margin-top: 6px; }

/* جدول النسخ يمتد بعرض اللوحة: سطر لكل نسخة، والضغط عليه يفتح تفاصيلها */
.bk-tbl { min-width: 980px; }
.bk-tbl td { padding-block: 12px; }

.badge.bk-full   { background: rgba(56,225,255,.1);  color: var(--cyan);   border: 1px solid rgba(56,225,255,.32); }
.badge.bk-weekly { background: rgba(151,123,255,.12); color: var(--violet); border: 1px solid rgba(151,123,255,.35); }
.badge.bk-db     { background: rgba(126,144,181,.1); color: var(--dim);    border: 1px solid rgba(126,144,181,.25); }

.bk-filter {
  display: flex; align-items: center; gap: 6px;
  color: var(--dim); font-size: 12px; font-weight: 600; cursor: pointer;
}
.bk-filter input { accent-color: var(--cyan); cursor: pointer; }

.bk-log {
  direction: ltr; text-align: left; font-family: var(--mono); font-size: 11.5px;
  line-height: 1.9; color: var(--dim); white-space: pre-wrap; word-break: break-word;
  max-height: 260px; overflow: auto;
}
.bk-dbs-head { margin: 16px 0 8px; font-weight: 700; font-size: 13px; }
.bk-dbs { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.bk-dbs .tbl tbody tr { cursor: default; }

@media (max-width: 1180px) {
  .bk-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ==== الملفات: شجرة المنشآت ==== */
.tn-tbl { table-layout: fixed; min-width: 940px; }
.tn-tbl th:nth-child(1), .tn-tbl td:nth-child(1) { width: auto; }
.tn-tbl th:nth-child(2), .tn-tbl td:nth-child(2) { width: 110px; }
.tn-tbl th:nth-child(3), .tn-tbl td:nth-child(3) { width: 95px; }
.tn-tbl th:nth-child(4), .tn-tbl td:nth-child(4) { width: 300px; }
.tn-tbl th:nth-child(5), .tn-tbl td:nth-child(5) { width: 150px; }
.tn-tbl td { overflow: hidden; text-overflow: ellipsis; }
.tn-tbl .f-txt { unicode-bidi: plaintext; }
.tn-tbl .f-link { color: var(--dim); font-size: 11px; margin-inline-start: 8px; }
.tn-tbl td.num { text-align: left; direction: ltr; }
.fs-only { display: flex; align-items: center; gap: 8px; }
.fs-only.hidden { display: none !important; }

/* ==== قواعد البيانات ==== */
.dbs-plat-tbl { min-width: 860px; }
.dbs-plat-tbl td { padding-block: 13px; }
.dbs-plat-tbl .f-name { font-weight: 700; }
.dbs-plat-tbl .f-link { color: var(--dim); font-size: 11px; margin-inline-start: 8px; }

.dbs-tbl { min-width: 1040px; }
.dbs-tbl td { padding-block: 11px; vertical-align: middle; }
.dbs-tbl td .mt-range-bar { max-width: 120px; }

/* ==== الدخول ==== */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-wrap { width: 380px; max-width: 94vw; }
.login-card .unit-head { justify-content: flex-start; }
.login-inner { padding: 30px 34px 26px; text-align: center; }
.login-logo .logo-svg { width: 60px; height: 60px; }
.login-inner h1 { font-size: 23px; font-weight: 800; margin: 10px 0 2px; }
.login-sub { color: var(--dim); font-size: 13px; margin-bottom: 22px; }
.login-err {
  background: rgba(255,93,115,.1); border: 1px solid rgba(255,93,115,.35); color: var(--red);
  border-radius: 9px; padding: 9px; font-size: 13px; margin-bottom: 14px;
}
.login-inner input {
  width: 100%; font-family: inherit; text-align: center;
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 10px;
  padding: 12px; font-size: 14.5px; margin-bottom: 12px;
}
.login-inner input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(56,225,255,.12); }
.login-inner button {
  width: 100%; font-family: inherit; font-weight: 800; font-size: 15px;
  background: linear-gradient(90deg, var(--cyan), #2ba8ff); color: #04121c;
  border: 0; border-radius: 10px; padding: 12px; cursor: pointer;
}
.login-inner button:hover { filter: brightness(1.1); }
.login-foot { margin-top: 20px; font-size: 10px; color: var(--dim); letter-spacing: 1.5px; }

/* ==== استجابة ==== */
@media (max-width: 1080px) {
  .gauges { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .side {
    width: 100%; height: auto; position: static; flex-direction: row;
    align-items: center; flex-wrap: wrap; gap: 8px;
    border-inline-end: 0; border-bottom: 1px solid var(--line);
  }
  .side-brand { padding: 0; }
  .side-nav { flex-direction: row; margin: 0; flex: 1; justify-content: center; }
  .nav-item { padding: 8px 10px; font-size: 12.5px; }
  .side-foot { margin: 0; flex-direction: row; }
  .pw-btn { padding: 8px 10px; font-size: 0; gap: 0; }
  .pw-btn svg { width: 16px; height: 16px; }
  .main { padding: 14px 12px 30px; }
  .gauges { gap: 8px; }
}
