/* cloud by FUDEX — الهوية 2026: مرجاني #FF5A3C + كحلي #121D40، Tajawal، أيقونات أوتلاين، صفر إيموجي */
@import url("https://kit.fudex.com.sa/v1/fonts/fonts.css?v=2026-09");

:root {
  --coral: #FF5A3C; --coral-2: #ff7a61; --coral-soft: #fff0ec;
  --navy: #121D40; --navy-2: #1d2a57; --navy-3: #2b3a6e;
  --bg: #f5f6fa; --surface: #ffffff; --surface-2: #f0f2f8; --line: #e3e6ef; --line-2: #d3d8e6;
  --text: #121D40; --text-2: #4a5475; --text-3: #7d86a3;
  --ok: #12a37a; --ok-soft: #e3f7f0; --warn: #d98a00; --warn-soft: #fff4de;
  --bad: #d93a3a; --bad-soft: #fde8e8; --info: #3867d6; --info-soft: #e8efff;
  --shadow: 0 1px 2px rgba(18,29,64,.06), 0 4px 16px rgba(18,29,64,.06);
  --radius: 14px; --radius-s: 10px;
  --nav-w: 232px; --top-h: 60px; --bottom-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1128; --surface: #121a38; --surface-2: #18214a; --line: #243061; --line-2: #2e3b72;
    --text: #eef1fb; --text-2: #b4bcda; --text-3: #7e88ad; --coral-soft: #3a1d1d;
    --ok-soft: #0f3a30; --warn-soft: #3b2c0c; --bad-soft: #3d1717; --info-soft: #17264f;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1128; --surface: #121a38; --surface-2: #18214a; --line: #243061; --line-2: #2e3b72;
  --text: #eef1fb; --text-2: #b4bcda; --text-3: #7e88ad; --coral-soft: #3a1d1d;
  --ok-soft: #0f3a30; --warn-soft: #3b2c0c; --bad-soft: #3d1717; --info-soft: #17264f;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.6;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .88em; direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--text-2); } .dim { color: var(--text-3); }
.small { font-size: 13px; } .tiny { font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.spacer { flex: 1; }
.ico { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.ico.s { width: 16px; height: 16px; } .ico.l { width: 26px; height: 26px; }

/* ───────── الهيكل ───────── */
.top {
  position: sticky; top: 0; z-index: 40; height: var(--top-h); display: flex; align-items: center; gap: 12px;
  padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img, .brand .mark { width: 34px; height: 34px; color: var(--text); flex: none; }
.brand b { font-size: 19px; font-weight: 800; color: var(--text); }
.brand span { font-size: 12px; color: var(--text-3); font-weight: 500; }
.tenant-btn {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface-2); cursor: pointer; max-width: 260px; min-width: 0;
}
.tenant-btn .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: 14px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 10px;
  background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.shell { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: calc(100vh - var(--top-h)); }
.side { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto;
  border-inline-end: 1px solid var(--line); background: var(--surface); padding: 14px 10px; }
.side a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none;
  color: var(--text-2); font-weight: 500; margin-bottom: 2px; }
.side a:hover { background: var(--surface-2); color: var(--text); }
.side a.on { background: var(--coral-soft); color: var(--coral); font-weight: 700; }
.side .sep { height: 1px; background: var(--line); margin: 10px 8px; }
.side .badge { margin-inline-start: auto; }
main { padding: 22px 24px 60px; min-width: 0; }
.page-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-h h1 { margin: 0; font-size: 24px; font-weight: 800; }
.page-h p { margin: 2px 0 0; color: var(--text-2); }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); text-decoration: none; font-size: 14px; margin-bottom: 6px; }
.crumb:hover { color: var(--coral); }

.bottom { display: none; }

/* ───────── المكوّنات ───────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 18px; }
.card h2, .card h3 { margin: 0 0 10px; font-size: 17px; font-weight: 700; }
.card .card-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card .card-h h3 { margin: 0; }
.card .card-b { padding: 16px 18px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; min-height: 40px; }
.btn:hover { border-color: var(--text-3); }
.btn.primary { background: var(--coral); border-color: var(--coral); color: #fff; }
.btn.primary:hover { background: #f04b2d; }
.btn.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 5px 11px; min-height: 32px; font-size: 13px; border-radius: 8px; }
.btn[disabled], .btn.busy { opacity: .55; cursor: not-allowed; pointer-events: none; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px;
  font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.coral { background: var(--coral-soft); color: var(--coral); }
.pill.navy { background: var(--navy); color: #fff; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--coral); color: #fff;
  font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }

.kpi { padding: 16px 18px; }
.kpi .l { color: var(--text-2); font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.kpi .v { font-size: 28px; font-weight: 800; margin-top: 4px; line-height: 1.2; }
.kpi .v small { font-size: 14px; font-weight: 600; color: var(--text-3); }
.kpi .s { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }

.field { display: block; }
.field > span { display: block; font-size: 13.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.input, select.input, textarea.input { width: 100%; padding: 10px 12px; border: 1px solid var(--line-2);
  border-radius: 10px; background: var(--surface); outline: none; min-height: 42px; }
.input:focus { border-color: var(--coral); box-shadow: 0 0 0 3px color-mix(in srgb, var(--coral) 18%, transparent); }
textarea.input { min-height: 90px; resize: vertical; }

.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: start; font-weight: 600; color: var(--text-3); font-size: 12.5px; padding: 10px 12px;
  border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: var(--surface-2); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto;
  scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--text-2); font-weight: 600; border-bottom: 2px solid transparent;
  white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.tabs a.on { color: var(--coral); border-bottom-color: var(--coral); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer;
  font-weight: 600; font-size: 13.5px; color: var(--text-2); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }

.empty { text-align: center; padding: 42px 20px; color: var(--text-2); }
.empty .ico { width: 44px; height: 44px; color: var(--text-3); stroke-width: 1.4; }
.empty h3 { margin: 12px 0 6px; color: var(--text); }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid; margin-bottom: 18px; }
.banner.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.banner.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.banner.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.banner .grow b { display: block; }

.bar { height: 7px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
.bar.warn > i { background: var(--warn); } .bar.bad > i { background: var(--bad); }
.meter { display: grid; grid-template-columns: 54px minmax(0, 1fr) 48px; align-items: center; gap: 8px; font-size: 12.5px; }
.meter .v { text-align: end; color: var(--text-2); font-variant-numeric: tabular-nums; }

.copy { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; border: 0; background: none; padding: 0; }
.copy:hover { color: var(--coral); }
.code { background: var(--navy); color: #e8ecff; border-radius: 10px; padding: 12px 14px; font-family: ui-monospace, Menlo, monospace;
  font-size: 12.5px; direction: ltr; text-align: left; white-space: pre-wrap; word-break: break-all; position: relative; }
.code .copy { position: absolute; top: 8px; right: 8px; color: #b9c2ec; }
.kv { margin: 0; display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--text-3); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ───────── بطاقات الخوادم ───────── */
.srv { display: block; text-decoration: none; padding: 16px; transition: border-color .15s; }
.srv:hover { border-color: var(--coral); }
.srv .h { display: flex; align-items: center; gap: 10px; }
.srv .h .ico-box { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--navy-3); }
[data-theme="dark"] .srv .h .ico-box { color: var(--text-2); }
.srv .name { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv .spec { color: var(--text-3); font-size: 13px; }
.srv .meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--text-2); }
.srv .meters { margin-top: 12px; display: grid; gap: 5px; }

/* ───────── المعالج ───────── */
.pick { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.opt { position: relative; padding: 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface);
  cursor: pointer; text-align: start; }
.opt:hover { border-color: var(--line-2); }
.opt.on { border-color: var(--coral); box-shadow: 0 0 0 3px color-mix(in srgb, var(--coral) 14%, transparent); }
.opt.on::after { content: ""; position: absolute; top: 10px; inset-inline-end: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--coral); }
.opt b { display: block; font-size: 15px; } .opt .d { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.opt .price { margin-top: 10px; font-weight: 800; font-size: 18px; }
.opt .price small { font-weight: 500; font-size: 12px; color: var(--text-3); }
.opt[disabled] { opacity: .45; cursor: not-allowed; }
.step { margin-bottom: 26px; }
.step > h3 { display: flex; align-items: center; gap: 10px; font-size: 16px; margin: 0 0 12px; }
.step > h3 i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 13px; }
.sumbar { position: sticky; bottom: 0; z-index: 20; margin: 20px -24px -60px; padding: 14px 24px; background: var(--surface);
  border-top: 1px solid var(--line); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; box-shadow: 0 -6px 20px rgba(18,29,64,.06); }
.sumbar .tot { font-size: 22px; font-weight: 800; }
.switch { position: relative; width: 44px; height: 24px; border-radius: 999px; background: var(--line-2); cursor: pointer; border: 0; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .15s; }
.switch.on { background: var(--coral); } .switch.on::after { inset-inline-start: 23px; }

/* ───────── الرسوم ───────── */
.chart { direction: ltr; position: relative; }
.chart .yl { position: absolute; left: 0; transform: translateY(-50%); font-size: 10.5px; color: var(--text-3); background: var(--surface); padding: 0 4px 0 0; line-height: 1; }
.chart .xl { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
.chart svg { width: 100%; height: 150px; display: block; }
.chart .ax { stroke: var(--line); stroke-width: 1; }
.chart .ln { fill: none; stroke-width: 2; }
.chart text { fill: var(--text-3); font-size: 10px; font-family: inherit; }

/* ───────── الطبقات ───────── */
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(11,17,40,.55); display: grid; place-items: center; padding: 16px; }
.modal { width: min(560px, 100%); max-height: 90vh; overflow-y: auto; background: var(--surface); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.wide { width: min(980px, 100%); }
.modal .mh { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal .mh h3 { margin: 0; font-size: 17px; }
.modal .mb { padding: 18px; } .modal .mf { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.toasts { position: fixed; z-index: 200; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; }
.toast.bad { background: var(--bad); } .toast.ok { background: var(--ok); }
.sheet-list a, .sheet-list button { display: flex; width: 100%; align-items: center; gap: 12px; padding: 12px 14px; border: 0;
  background: none; text-decoration: none; border-radius: 10px; cursor: pointer; text-align: start; }
.sheet-list a:hover, .sheet-list button:hover { background: var(--surface-2); }
.vnc { background: #000; border-radius: 10px; min-height: 420px; overflow: hidden; direction: ltr; }
.vnc > div { width: 100%; height: 100%; }

/* ───────── الصفحة العامة ───────── */
.landing { max-width: 1120px; margin: 0 auto; padding: 32px 16px 70px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: center; padding: 30px 0 40px; }
.hero h1 { font-size: 44px; line-height: 1.25; margin: 0 0 14px; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--coral); }
.hero p { font-size: 18px; color: var(--text-2); margin: 0 0 22px; }
.hero-art { background: var(--navy); border-radius: 22px; padding: 22px; color: #fff; box-shadow: var(--shadow); }
.hero-art .ln { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.06); margin-bottom: 8px; font-size: 14px; }
.hero-art .ln .spacer { flex: 1; }
.offer { padding: 20px; }
.offer .ico { color: var(--coral); width: 30px; height: 30px; }
.offer h3 { margin: 10px 0 6px; } .offer p { margin: 0; color: var(--text-2); font-size: 14.5px; }
.section-h { font-size: 26px; font-weight: 800; margin: 44px 0 16px; }
.foot { margin-top: 50px; color: var(--text-3); font-size: 13px; text-align: center; }

/* ───────── الجوال ───────── */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  main { padding: 16px 16px calc(var(--bottom-h) + 30px); }
  .bottom { display: flex; position: fixed; z-index: 50; bottom: 0; inset-inline: 0; height: var(--bottom-h);
    background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .bottom a, .bottom button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    text-decoration: none; color: var(--text-3); font-size: 11.5px; font-weight: 600; border: 0; background: none; cursor: pointer; position: relative; }
  .bottom a.on { color: var(--coral); }
  .bottom .badge { position: absolute; top: 6px; inset-inline-start: calc(50% + 6px); height: 17px; min-width: 17px; font-size: 10.5px; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-h h1 { font-size: 21px; }
  .brand span { display: none; }
  .tenant-btn { max-width: 150px; }
  .kv { grid-template-columns: 110px minmax(0, 1fr); }
  .sumbar { margin: 20px -16px 0; padding: 12px 16px; bottom: var(--bottom-h); }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: 32px; }
  .modal-bg { align-items: end; padding: 0; }
  .modal { border-radius: 18px 18px 0 0; max-height: 88vh; }
  .toasts { bottom: calc(var(--bottom-h) + 14px); }
  .kpi .v { font-size: 23px; }
}
