/* IT.JO brand: navy ground, blue → violet accent, Manrope (Latin) + Tajawal (Arabic), self-hosted. */
@font-face { font-family: "Manrope"; font-weight: 400; font-display: swap; src: url(fonts/manrope-latin-400.woff2) format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 500; font-display: swap; src: url(fonts/manrope-latin-500.woff2) format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 600; font-display: swap; src: url(fonts/manrope-latin-600.woff2) format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 700; font-display: swap; src: url(fonts/manrope-latin-700.woff2) format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 800; font-display: swap; src: url(fonts/manrope-latin-800.woff2) format("woff2"); }
@font-face { font-family: "Tajawal"; font-weight: 400; font-display: swap; src: url(fonts/tajawal-arabic-400.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Tajawal"; font-weight: 500; font-display: swap; src: url(fonts/tajawal-arabic-500.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Tajawal"; font-weight: 700; font-display: swap; src: url(fonts/tajawal-arabic-700.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }

:root {
  --navy: #050e21;
  --brand: #1554fa;
  --brand-2: #6963fc;
  --brand-grad: linear-gradient(120deg, #1554fa 0%, #6963fc 100%);
  --brand-soft: #e8eeff;
  --bg: #f4f6fb;
  --ink: #0b1224;
  --muted: #6b7487;
  --line: #e3e7f0;
  --card: #ffffff;
  --ok: #128a4b;
  --ok-soft: #e2f5ea;
  --amber: #a86100;
  --amber-soft: #fdf0dc;
  --red: #c4302b;
  --red-soft: #fce8e7;
  --blue: #1554fa;
  --blue-soft: #e8eeff;
  --grey-soft: #eef0f5;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(11, 18, 36, .05), 0 6px 20px rgba(11, 18, 36, .06);
  --font: "Manrope", "Tajawal", system-ui, sans-serif;
}
[dir="rtl"] { --font: "Tajawal", "Manrope", system-ui, sans-serif; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-weight: 800; margin: 0; line-height: 1.2; letter-spacing: -.01em; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { letter-spacing: 0; font-weight: 700; }
h1 { font-size: 27px; }
h2 { font-size: 18px; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
bdi { white-space: nowrap; }
[dir="rtl"] .ltr { direction: ltr; unicode-bidi: isolate; }

/* top bar (navy, like the IT.JO portals) */
.topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 5; box-shadow: 0 1px 0 rgba(255,255,255,.06); }
.topbar-in { max-width: 1180px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand img { height: 30px; display: block; }
.brand .product { font-weight: 700; font-size: 15px; color: #c9d4f2; padding-inline-start: 14px; border-inline-start: 1px solid rgba(255,255,255,.18); white-space: nowrap; }
.spacer { flex: 1; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang button { border: 0; background: transparent; padding: 5px 12px; font-weight: 700; color: var(--muted); }
.lang button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.topbar .lang { border-color: rgba(255,255,255,.22); }
.topbar .lang button { color: #b9c4e4; }
.topbar .lang button[aria-pressed="true"] { background: #fff; color: var(--navy); }
.link-btn { white-space: nowrap; border: 0; background: none; color: #c9d4f2; font-weight: 600; padding: 6px 10px; border-radius: 8px; }
.link-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

/* layout */
.page { max-width: 1180px; margin: 0 auto; padding: 28px 24px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.section { padding: 20px 22px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-title .hint { color: var(--muted); font-size: 13px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 10px; padding: 10px 18px; font-weight: 700; text-decoration: none; background: var(--brand-grad); color: #fff; box-shadow: 0 4px 14px rgba(21, 84, 250, .25); transition: filter .15s, box-shadow .15s; }
.btn:hover { filter: brightness(1.06); box-shadow: 0 6px 18px rgba(21, 84, 250, .32); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.secondary { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.secondary:hover { background: var(--grey-soft); filter: none; }
.btn .plus { font-size: 18px; line-height: 1; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.kpi { padding: 18px 20px; }
.kpi .label { color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi .value { font-size: 30px; font-weight: 800; margin-top: 2px; letter-spacing: -.02em; }
.kpi .sub { color: var(--muted); font-size: 13px; }
.kpi .value.warn { color: var(--amber); }
.kpi .value.bad { color: var(--red); }
.kpi .value.good { color: var(--ok); }
.bar { height: 6px; background: var(--grey-soft); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.bar > i { display: block; height: 100%; background: var(--brand-grad); border-radius: 99px; }

/* server cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 16px; }
.grid > *, .kpis > *, .cols > *, .step > div { min-width: 0; }
.srv { display: block; text-decoration: none; padding: 18px 20px; transition: transform .12s, box-shadow .12s; border: 1px solid transparent; }
.srv:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(11, 18, 36, .06), 0 12px 30px rgba(21, 84, 250, .1); border-color: #d6def5; }
.srv-head { display: flex; align-items: center; gap: 12px; }
.os { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--grey-soft); color: var(--ink); }
.os.win { background: var(--brand-soft); color: var(--brand); }
.os.linux { background: #efecff; color: #5a4fe0; }
.srv-name { font-weight: 800; font-size: 17px; overflow-wrap: anywhere; }
.srv-sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[dir="rtl"] .srv-sub { text-align: right; }
.srv-head .titles { min-width: 0; flex: 1; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin-top: 16px; }
.fact .k { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
[dir="rtl"] .fact .k { text-transform: none; letter-spacing: 0; font-size: 13px; }
.fact .v { font-weight: 700; }
.err-line { margin-top: 14px; font-size: 13px; color: var(--red); background: var(--red-soft); border-radius: 8px; padding: 8px 10px; overflow-wrap: anywhere; }
.sync-line { margin-top: 14px; font-size: 13px; color: var(--blue); }

/* status pill */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--amber-soft); color: var(--amber); }
.pill.bad { background: var(--red-soft); color: var(--red); }
.pill.sync { background: var(--blue-soft); color: var(--blue); }
.pill.sync::before { animation: pulse 1.2s infinite; }
.pill.wait { background: var(--grey-soft); color: var(--muted); }
@keyframes pulse { 50% { opacity: .25; } }

/* detail */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 600; margin-bottom: 14px; }
.back:hover { color: var(--brand); }
[dir="rtl"] .back .arrow { transform: scaleX(-1); display: inline-block; }
.detail-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.detail-head .os { width: 52px; height: 52px; border-radius: 14px; }
.detail-head .titles { min-width: 0; flex: 1; }
.detail-head .srv-sub { white-space: normal; overflow-wrap: anywhere; }
.meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 20px; }
.cols { display: grid; grid-template-columns: 1fr 1.35fr; gap: 16px; margin-top: 16px; align-items: start; }
.alert { border-radius: 12px; padding: 12px 14px; margin-top: 16px; font-size: 14px; }
.alert.bad { background: var(--red-soft); color: var(--red); }
.alert.info { background: var(--blue-soft); color: var(--blue); }
.alert b { display: block; margin-bottom: 2px; }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: start; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 0 10px 8px; border-bottom: 1px solid var(--line); }
[dir="rtl"] th { text-transform: none; letter-spacing: 0; font-size: 13px; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: end; }
.when { font-weight: 700; }
.when-sub { color: var(--muted); font-size: 12px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); margin-inline-start: 6px; vertical-align: 1px; }
.ok-dot, .bad-dot { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.ok-dot { color: var(--ok); }
.bad-dot { color: var(--red); }
.ok-dot::before, .bad-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.table-wrap { overflow-x: auto; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty h2 { color: var(--ink); margin-bottom: 6px; }

/* forms */
.field { display: grid; gap: 6px; margin-bottom: 16px; align-content: start; }
.field label { font-weight: 700; font-size: 14px; }
.field .help { color: var(--muted); font-size: 13px; }
input[type="text"], input[type="password"] { font: inherit; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); width: 100%; }
input:focus { border-color: var(--brand); }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid rgba(21, 84, 250, .35); outline-offset: 2px; }
.field .seg { justify-self: start; }
.seg { display: inline-flex; background: var(--grey-soft); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; padding: 9px 16px; border-radius: 9px; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.form-error { color: var(--red); font-weight: 600; margin: -6px 0 14px; font-size: 14px; }
.steps { counter-reset: step; display: grid; gap: 22px; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 14px; }
.step::before { counter-increment: step; content: counter(step); width: 34px; height: 34px; border-radius: 50%; background: var(--brand-grad); color: #fff; font-weight: 800; display: grid; place-items: center; }
.step h3 { font-size: 16px; margin: 5px 0 8px; }
.step p { margin: 0 0 10px; color: var(--muted); }
pre.code { direction: ltr; text-align: left; background: var(--navy); color: #dbe4ff; border-radius: 12px; padding: 16px 18px; font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-x: auto; margin: 0; white-space: pre; }
.code-box { position: relative; }
.code-box .copy { position: absolute; top: 10px; inset-inline-end: 10px; background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 8px; padding: 6px 10px; font-size: 13px; font-weight: 700; }
.code-box .copy:hover { background: rgba(255,255,255,.22); }
.note { background: var(--amber-soft); color: #6e4300; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 12px; }
ul.plain { margin: 0; padding-inline-start: 18px; color: var(--muted); }
ul.plain li { margin: 4px 0; }

/* login: form on white + navy brand panel (same layout as the IT.JO portals) */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: #fff; }
.login-form-side { display: grid; place-items: center; padding: 32px 24px; }
.login { width: 100%; max-width: 380px; }
.login .logo-dark { height: 40px; margin-bottom: 26px; }
.login h1 { font-size: 26px; margin-bottom: 4px; }
.login p { color: var(--muted); margin: 0 0 24px; }
.login .btn { width: 100%; justify-content: center; padding: 12px; }
.login-foot { display: flex; justify-content: center; margin-top: 20px; }
.login-brand { position: relative; overflow: hidden; background: radial-gradient(1200px 700px at 30% 40%, #10255f 0%, var(--navy) 55%, #030916 100%); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 60px 8%; }
.login-brand::before { content: ""; position: absolute; width: 120%; aspect-ratio: 1; border: 1.5px solid rgba(46, 120, 255, .55); border-radius: 50%; inset-inline-start: -10%; top: 6%; pointer-events: none; }
.login-brand > * { position: relative; }
.login-brand img { height: 74px; align-self: flex-start; margin-bottom: 40px; }
.login-brand .tagline { font-size: 34px; font-weight: 800; letter-spacing: -.01em; }
.login-brand .services { color: #c9d4f2; font-size: 19px; margin-top: 6px; }
.login-brand .services i { font-style: normal; color: var(--brand); margin: 0 8px; }
.login-brand .portal { font-size: 30px; font-weight: 800; margin-top: 56px; }
.login-brand .portal::after { content: ""; display: block; width: 64px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, #1e8bff, var(--brand)); margin-top: 10px; }
[dir="rtl"] .login-brand .tagline, [dir="rtl"] .login-brand .portal { letter-spacing: 0; }

.updated { color: var(--muted); font-size: 12px; }
.skeleton { color: var(--muted); padding: 60px 0; text-align: center; }

@media (max-width: 980px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .cols { grid-template-columns: 1fr; }
  .meta { grid-template-columns: repeat(2, 1fr); }
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { order: -1; padding: 28px 24px; }
  .login-brand::before { display: none; }
  .login-brand img { height: 44px; margin-bottom: 14px; }
  .login-brand .tagline { font-size: 22px; }
  .login-brand .services { font-size: 14px; }
  .login-brand .portal { font-size: 20px; margin-top: 18px; }
  .login .logo-dark { display: none; }
}
@media (max-width: 560px) {
  .topbar-in { padding: 10px 14px; gap: 10px; }
  .brand img { height: 24px; }
  .brand .product { display: none; }
  .page { padding: 20px 14px 48px; }
  h1 { font-size: 23px; }
  .kpis { gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .value { font-size: 24px; }
  .grid { grid-template-columns: 1fr; }
  .section { padding: 16px; }
  .hide-sm { display: none; }
  .page-head .btn { width: 100%; justify-content: center; }
}

/* ---------- phase 1: navigation, filters, forms, panels ---------- */
.nav { display: flex; gap: 4px; margin-inline-start: 18px; }
.nav a { color: #b9c4e4; text-decoration: none; font-weight: 600; font-size: 14px; padding: 7px 12px; border-radius: 8px; white-space: nowrap; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav a.active { color: #fff; background: rgba(21, 84, 250, .35); }
.who { display: inline-flex; align-items: center; gap: 8px; color: #dbe4ff; text-decoration: none; padding: 4px 8px 4px 4px; border-radius: 999px; }
[dir="rtl"] .who { padding: 4px 4px 4px 8px; }
.who:hover, .who.active { background: rgba(255,255,255,.1); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-grad); color: #fff; font-weight: 800; font-size: 13px; }
.who-name { font-weight: 600; font-size: 14px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.toolbar { display: flex; align-items: center; gap: 10px; margin: -6px 0 16px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 13px; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip b { background: var(--red); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; margin-inline-start: 4px; }
select, input[type="search"], input[type="email"], input[type="number"] { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.toolbar select, .toolbar input[type="search"] { padding: 8px 12px; min-width: 180px; }
.page-head input[type="search"] { min-width: 240px; }
.field select, .field input[type="email"], .field input[type="number"] { width: 100%; }
input:disabled, select:disabled { background: var(--grey-soft); color: var(--muted); }

.dot { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.on { color: var(--ok); }
.dot.on::before { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.off { color: var(--red); }
.dot.off::before { background: var(--red); }

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.btn.danger { background: var(--red); box-shadow: 0 4px 14px rgba(196, 48, 43, .25); }
.btn.secondary.danger-text { color: var(--red); }
.btn.secondary.danger-text:hover { background: var(--red-soft); }
.panel { margin-top: 16px; border: 1px solid #d6def5; }
.panel h2 { margin-bottom: 8px; }
.danger-panel { border-color: #f1c4c2; background: #fffafa; }
.alert.warn { background: var(--amber-soft); color: var(--amber); }
.tag.warn { background: var(--amber-soft); color: var(--amber); }
.muted { color: var(--muted); }
.err-sub { color: var(--red); max-width: 280px; overflow-wrap: anywhere; }
.row-warn td { background: #fffaf3; }
.detail-cell { max-width: 360px; overflow-wrap: anywhere; color: var(--muted); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .span2 { grid-column: 1 / -1; }
.unit { display: flex; align-items: center; gap: 10px; }
.unit input { max-width: 120px; }
.unit span { color: var(--muted); font-weight: 600; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row-btns .spacer { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 16px; }
.check input { width: 18px; height: 18px; }
.text-btn { border: 0; background: none; color: var(--brand); font-weight: 700; padding: 6px; }
.link-btn.dark { color: var(--brand); }
.link-btn.dark:hover { background: var(--brand-soft); color: var(--brand); }
.code-input { font-size: 22px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
pre.code.big { font-size: 22px; letter-spacing: .08em; text-align: center; padding: 22px; }
.cols.even { grid-template-columns: 1fr 1fr; }
.tfa-setup { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.tfa-setup img { border-radius: 12px; border: 1px solid var(--line); image-rendering: pixelated; background: #fff; }
code.secret { display: inline-block; margin-top: 6px; font: 15px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--grey-soft); padding: 8px 12px; border-radius: 8px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 600; box-shadow: 0 10px 30px rgba(11,18,36,.25); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1100px) {
  .who-name { display: none; }
}
@media (max-width: 980px) {
  .cols.even { grid-template-columns: 1fr; }
  .topbar-in { flex-wrap: wrap; }
  .nav { order: 10; width: 100%; margin: 4px 0 0; overflow-x: auto; }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .toolbar select, .toolbar input[type="search"], .page-head input[type="search"] { min-width: 0; width: 100%; }
  .actions .btn { flex: 1 1 auto; justify-content: center; }
  .lang button { padding: 4px 9px; }
}
