@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=Space+Grotesk:wght@500;600&display=swap');

:root {
  color-scheme: dark;
  --bg: #050b15;
  --panel: rgba(12, 22, 39, .78);
  --panel-strong: #0c1729;
  --line: rgba(159, 184, 219, .12);
  --text: #f3f7ff;
  --muted: #8190a8;
  --cyan: #38e6ca;
  --cyan-soft: rgba(56, 230, 202, .14);
  --orange: #ff8a47;
  --orange-soft: rgba(255, 138, 71, .14);
  --blue: #5d8dff;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef3f9;
  --panel: rgba(255, 255, 255, .9);
  --panel-strong: #ffffff;
  --line: rgba(35, 60, 92, .14);
  --text: #102038;
  --muted: #65748a;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    radial-gradient(circle at 74% -10%, #122c48 0, transparent 36%),
    var(--bg);
  background-size: 44px 44px, 44px 44px, auto, auto;
}
html[data-theme="light"] body {
  background:
    linear-gradient(rgba(15,45,80,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,45,80,.035) 1px, transparent 1px),
    radial-gradient(circle at 74% -10%, #c9e7f3 0, transparent 38%),
    var(--bg);
  background-size: 44px 44px, 44px 44px, auto, auto;
}

button, input { font: inherit; }
button { color: inherit; }
.ambient { position: fixed; border-radius: 50%; filter: blur(90px); opacity: .13; pointer-events: none; }
.ambient-one { width: 360px; height: 360px; background: var(--cyan); top: 15%; right: -220px; }
.ambient-two { width: 300px; height: 300px; background: var(--orange); bottom: -200px; left: 8%; }
.shell { width: min(1400px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 56px; position: relative; }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.brand { display: flex; gap: 14px; align-items: center; }
.brand h1 { font-size: 24px; line-height: 1; margin: 6px 0 0; letter-spacing: -.02em; }
.eyebrow { direction: ltr; color: var(--muted); font: 600 10px/1 'Space Grotesk', sans-serif; letter-spacing: .18em; margin: 0; }
.logo-frame { width: 74px; height: 74px; display: grid; place-items: center; overflow: hidden; border-radius: 12px; background: #fff; border: 1px solid rgba(245,187,45,.34); box-shadow: 0 10px 32px rgba(0,0,0,.2); transition: transform .3s ease, box-shadow .3s ease; }
.logo-frame:hover { transform: translateY(-3px) rotate(-1deg); box-shadow: 0 16px 40px rgba(0,0,0,.28), 0 0 24px rgba(245,187,45,.12); }
.site-logo { width: 68px; height: 68px; object-fit: contain; }
.toolbar { display: flex; align-items: center; gap: 10px; }
.live-state { height: 40px; padding: 0 14px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); background: rgba(10,18,31,.8); font-size: 13px; color: var(--muted); }
.live-state i { width: 7px; height: 7px; border-radius: 50%; background: #f0b24b; box-shadow: 0 0 12px currentColor; }
.live-state.live { color: var(--cyan); }.live-state.live i { background: var(--cyan); animation: pulse 1.8s infinite; }
.live-state.error { color: #ff667e; }.live-state.error i { background: #ff667e; }
@keyframes pulse { 50% { opacity: .35; } }
.icon-button, .text-button { border: 1px solid var(--line); background: rgba(12,23,41,.88); cursor: pointer; transition: .2s ease; }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; }
.icon-button:hover, .text-button:hover { border-color: rgba(56,230,202,.4); background: var(--cyan-soft); }
.icon-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.theme-button { font: 500 19px/1 sans-serif; }
.icon-button.loading svg { animation: rotate .75s linear infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }

.hero-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.metric-card, .status-card, .panel { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(15,29,50,.94), rgba(7,14,26,.92)); box-shadow: 0 20px 70px rgba(0,0,0,.18); }
.metric-card { min-height: 238px; padding: 26px; position: relative; overflow: hidden; transition: transform .28s ease, border-color .28s ease, box-shadow .28s ease; }
.metric-card:hover { transform: translateY(-4px); border-color: rgba(110,158,220,.28); box-shadow: 0 26px 72px rgba(0,0,0,.26); }
.metric-card::before { content: ''; position: absolute; width: 190px; height: 190px; border-radius: 50%; filter: blur(65px); opacity: .09; top: -75px; left: -45px; }
.online-card::before { background: var(--cyan); }.current-card::before { background: var(--blue); }.offline-card::before { background: var(--orange); }
.metric-head { display: flex; align-items: center; justify-content: space-between; color: #aab7ca; font-size: 14px; }
.metric-icon { direction: ltr; width: 38px; height: 38px; display: grid; place-items: center; font-family: sans-serif; border: 1px solid; border-radius: 10px; transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease; }
.metric-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.metric-card:hover .metric-icon { transform: scale(1.12) rotate(-5deg); box-shadow: 0 8px 24px rgba(0,0,0,.16); }
.online-icon { color: var(--cyan); background: var(--cyan-soft); border-color: rgba(56,230,202,.2); }
.offline-icon { color: var(--orange); background: var(--orange-soft); border-color: rgba(255,138,71,.22); }
.current-icon { color: var(--blue); background: rgba(93,141,255,.14); border-color: rgba(93,141,255,.22); }
.metric-card > strong { direction: ltr; display: block; width: fit-content; font: 600 66px/.95 'Space Grotesk', sans-serif; letter-spacing: -.06em; margin: 20px 0 10px; }
.online-card > strong { color: var(--cyan); text-shadow: 0 0 34px rgba(56,230,202,.14); }
.current-card > strong { color: var(--blue); text-shadow: 0 0 34px rgba(93,141,255,.14); }
.offline-card > strong { color: var(--orange); text-shadow: 0 0 34px rgba(255,138,71,.14); }
.metric-card > p, .status-card p { color: var(--muted); font-size: 12px; margin: 0; }
.sparkline { direction: ltr; position: absolute; left: 24px; right: 24px; bottom: 18px; height: 32px; display: flex; align-items: end; gap: 3px; opacity: .5; }
.sparkline i { flex: 1; min-width: 2px; background: var(--cyan); transition: height .35s ease; }
.mini-stats { display: flex; gap: 28px; position: absolute; bottom: 22px; right: 26px; }
.mini-stats div { display: grid; gap: 3px; }.mini-stats span { color: var(--muted); font-size: 10px; }.mini-stats b { direction: ltr; font: 600 16px 'Space Grotesk'; }
.status-card { min-height: 238px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 20px; padding: 24px; }
.status-card span { color: var(--muted); font-size: 12px; }.status-card strong { direction: ltr; display: block; font: 600 32px 'Space Grotesk'; margin: 5px 0 2px; }.status-card p b { color: #d5deed; }
.radar { width: 72px; height: 72px; border: 1px solid rgba(93,141,255,.28); border-radius: 50%; position: relative; background: radial-gradient(circle, rgba(93,141,255,.23) 0 2px, transparent 3px), conic-gradient(from 180deg, transparent 68%, rgba(93,141,255,.25)); }
.radar::before, .radar::after { content: ''; position: absolute; inset: 15px; border: 1px solid rgba(93,141,255,.2); border-radius: 50%; }.radar::after { inset: 32px; background: var(--blue); box-shadow: 0 0 16px var(--blue); }
.radar i { position: absolute; width: 50%; height: 1px; top: 50%; left: 50%; background: linear-gradient(90deg, var(--blue), transparent); transform-origin: left; animation: radar 3s linear infinite; }
@keyframes radar { to { transform: rotate(360deg); } }

.panel { overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 24px 26px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 7px 0 0; font-size: 20px; }
.panel-actions { display: flex; gap: 10px; align-items: center; }
.search-box { width: 230px; height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); background: rgba(4,11,21,.65); }
.search-box:focus-within { border-color: rgba(56,230,202,.4); }.search-box svg { width: 16px; fill: none; stroke: var(--muted); stroke-width: 1.8; }.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); }.search-box input::placeholder { color: #536176; }
.text-button { height: 40px; padding: 0 15px; font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th { color: #6f7d92; font-size: 10px; font-weight: 600; letter-spacing: .05em; text-align: right; padding: 13px 26px; border-bottom: 1px solid var(--line); }
td { padding: 15px 26px; border-bottom: 1px solid rgba(159,184,219,.07); font-size: 13px; }
tbody tr { transition: background .2s; } tbody tr:hover { background: rgba(93,141,255,.035); } tbody tr.leader { background: rgba(56,230,202,.035); }
.server-name { display: flex; align-items: center; gap: 11px; font-weight: 600; }.server-name i { width: 4px; height: 30px; background: #263852; }.leader .server-name i { background: var(--cyan); box-shadow: 0 0 14px rgba(56,230,202,.45); }.server-name small { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }
.address { direction: ltr; text-align: right; color: #91a0b7; font: 500 12px 'Space Grotesk', monospace; }
.badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; background: rgba(56,230,202,.08); color: var(--cyan); border: 1px solid rgba(56,230,202,.14); font-size: 11px; }.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }.badge.off { color: #ff667e; background: rgba(255,102,126,.08); border-color: rgba(255,102,126,.14); }
.delta { direction: ltr; display: inline-block; min-width: 42px; color: #6f7d92; font: 500 12px 'Space Grotesk'; }.delta.up { color: var(--cyan); }.delta.down { color: var(--orange); }
.online-number { direction: ltr; text-align: right; color: #dbe5f4; font: 600 18px 'Space Grotesk'; }.leader .online-number { color: var(--cyan); }
.offline-number { direction: ltr; text-align: right; color: var(--orange); font: 600 18px 'Space Grotesk'; }
.empty-state { text-align: center; color: var(--muted); padding: 50px; }
.panel-footer { display: flex; justify-content: space-between; padding: 15px 26px; color: #58667a; font-size: 10px; letter-spacing: .02em; }
.credit { direction: ltr; color: var(--muted); font: 500 11px 'Space Grotesk', sans-serif; }
.toast { position: fixed; left: 24px; bottom: 24px; max-width: 360px; padding: 12px 16px; border: 1px solid rgba(255,102,126,.3); background: #24121b; color: #ff9bab; font-size: 12px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .25s; }.toast.show { opacity: 1; transform: none; }
.reset-dialog { width: min(440px, calc(100% - 28px)); color: var(--text); padding: 0; border: 1px solid rgba(93,141,255,.25); border-radius: 18px; background: #0c1729; box-shadow: 0 32px 100px rgba(0,0,0,.55); }
.reset-dialog::backdrop { background: rgba(2,7,14,.76); backdrop-filter: blur(7px); }
.reset-dialog form { position: relative; padding: 30px; }
.dialog-close { position: absolute; top: 14px; left: 14px; width: 32px; height: 32px; border: 0; border-radius: 9px; color: var(--muted); background: rgba(255,255,255,.05); cursor: pointer; font-size: 21px; transition: .2s; }
.dialog-close:hover { color: var(--text); background: rgba(255,255,255,.1); transform: rotate(8deg); }
.dialog-lock { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 14px; color: var(--blue); background: rgba(93,141,255,.12); border: 1px solid rgba(93,141,255,.22); }
.dialog-lock svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.reset-dialog h3 { margin: 8px 0 6px; font-size: 23px; }.reset-dialog form > p:not(.eyebrow) { margin: 0 0 22px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.reset-dialog label { display: block; margin-bottom: 8px; color: #aab7ca; font-size: 12px; }
.reset-dialog input { width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; outline: none; color: var(--text); background: rgba(3,9,18,.7); direction: ltr; transition: border-color .2s, box-shadow .2s; }
.reset-dialog input:focus { border-color: rgba(93,141,255,.7); box-shadow: 0 0 0 4px rgba(93,141,255,.12); }
.dialog-actions { display: flex; gap: 10px; margin-top: 20px; }.dialog-actions button { flex: 1; border-radius: 10px; }
.confirm-button { height: 42px; border: 1px solid rgba(93,141,255,.45); color: #fff; background: linear-gradient(135deg, #527ff0, #6b54e8); cursor: pointer; transition: transform .2s, box-shadow .2s; }.confirm-button:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(93,141,255,.28); }

html[data-theme="light"] .metric-card,
html[data-theme="light"] .status-card,
html[data-theme="light"] .panel { background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(242,247,252,.96)); box-shadow: 0 18px 55px rgba(37,63,94,.1); }
html[data-theme="light"] .icon-button,
html[data-theme="light"] .text-button,
html[data-theme="light"] .live-state { background: rgba(255,255,255,.88); }
html[data-theme="light"] .search-box { background: rgba(241,246,251,.9); }
html[data-theme="light"] .online-number { color: #263a55; }
html[data-theme="light"] .status-card p b { color: #263a55; }
html[data-theme="light"] tbody tr:hover { background: rgba(45,100,170,.045); }
html[data-theme="light"] tbody tr.leader { background: rgba(20,180,155,.055); }
html[data-theme="light"] .toast { background: #fff1f3; }
html[data-theme="light"] .reset-dialog { background: #fff; }
html[data-theme="light"] .reset-dialog input { color: #102038; background: #f4f7fb; }
html[data-theme="light"] .dialog-close { background: rgba(20,40,70,.06); }

@media (max-width: 1100px) { .hero-grid { grid-template-columns: 1fr 1fr; }.status-card { min-height: 180px; }.panel-head { align-items: flex-start; }.panel-actions { flex-direction: column; align-items: stretch; }.search-box { width: 210px; } }
@media (max-width: 640px) { .shell { width: min(100% - 24px, 1400px); padding-top: 16px; }.topbar { margin-bottom: 16px; }.eyebrow { font-size: 8px; }.brand h1 { font-size: 18px; }.logo-frame { width: 58px; height: 58px; }.site-logo { width: 54px; height: 54px; }.live-state { display: none; }.hero-grid { grid-template-columns: 1fr; }.status-card { grid-column: auto; }.metric-card { min-height: 220px; padding: 22px; }.metric-card > strong { font-size: 56px; }.panel-head { flex-direction: column; gap: 18px; padding: 20px; }.panel-actions, .search-box { width: 100%; }.panel-footer { flex-direction: column; gap: 5px; }.toast { left: 12px; right: 12px; bottom: 12px; }.reset-dialog form { padding: 24px; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
