/* חדר השרתים — "holographic" dark theme + light theme, RTL, mobile first */
@font-face {
  font-family: 'Heebo';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/static/fonts/heebo-hebrew-wght-normal.woff2) format('woff2');
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: 'Heebo';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/static/fonts/heebo-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #050a18;
  --bg-2: #0a1430;
  --panel: rgba(16, 30, 64, 0.55);
  --panel-solid: #0e1b3d;
  --border: rgba(96, 200, 255, 0.18);
  --border-strong: rgba(96, 200, 255, 0.42);
  --text: #e6f1ff;
  --muted: #8aa3c7;
  --accent: #39d0ff;
  --accent-2: #a77bff;
  --glow: 0 0 24px rgba(57, 208, 255, 0.18);
  --ok: #2ee6a6;
  --warn: #ffc247;
  --error: #ff5470;
  --busy: #7aa7ff;
  --unknown: #8aa3c7;
  --ok-bg: rgba(46, 230, 166, 0.12);
  --warn-bg: rgba(255, 194, 71, 0.13);
  --error-bg: rgba(255, 84, 112, 0.14);
  --grid: rgba(57, 208, 255, 0.05);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  color-scheme: dark;
}
:root[data-theme='light'] {
  --bg: #eef3fb;
  --bg-2: #ffffff;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --border: rgba(30, 80, 160, 0.14);
  --border-strong: rgba(30, 110, 220, 0.38);
  --text: #0b1a33;
  --muted: #546a8c;
  --accent: #0a86c9;
  --accent-2: #6b46e0;
  --glow: 0 0 0 rgba(0, 0, 0, 0);
  --ok: #0c9a6a;
  --warn: #b7780a;
  --error: #d42a48;
  --busy: #3c66d6;
  --ok-bg: rgba(12, 154, 106, 0.1);
  --warn-bg: rgba(220, 150, 20, 0.13);
  --error-bg: rgba(212, 42, 72, 0.1);
  --grid: rgba(10, 80, 180, 0.05);
  --shadow: 0 6px 24px rgba(20, 40, 90, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Heebo', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(167, 123, 255, 0.16), transparent 60%),
    radial-gradient(900px 500px at 0% 10%, rgba(57, 208, 255, 0.12), transparent 60%),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
.wrap { max-width: 1280px; margin: 0 auto; padding: 16px; }
@media (min-width: 720px) { .wrap { padding: 24px 28px 48px; } }

.topbar { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0.3px; }
.brand-logo {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-size: 18px;
  box-shadow: 0 0 18px rgba(57, 208, 255, 0.35);
}
.top-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn {
  min-width: 40px; height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--panel); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: border-color 0.2s, transform 0.1s;
}
.icon-btn:hover { border-color: var(--border-strong); }
.icon-btn:active { transform: scale(0.97); }
.icon-btn .label { display: none; }
@media (min-width: 720px) { .icon-btn .label { display: inline; } }

/* ---------- hero ---------- */
.hero { display: grid; gap: 16px; margin-bottom: 18px; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.1fr 1fr; align-items: stretch; } }
.greet h1 {
  margin: 0; font-size: clamp(1.7rem, 4.5vw, 2.6rem); font-weight: 800; line-height: 1.15;
  background: linear-gradient(90deg, var(--text), var(--accent) 60%, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.greet p { margin: 6px 0 0; color: var(--muted); }
.summary-line { margin-top: 10px; font-size: 1.05rem; font-weight: 600; }

.counters { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .counters { grid-template-columns: repeat(4, 1fr); } }
.counter {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--glow);
}
.counter .num { font-size: 1.9rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.counter .lbl { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.counter.ok .num { color: var(--ok); }
.counter.warn .num { color: var(--warn); }
.counter.error .num { color: var(--error); }

/* ---------- alerts ---------- */
.alerts { display: grid; gap: 8px; margin-bottom: 18px; }
.alert {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px;
  border: 1px solid; font-weight: 500;
}
.alert.error { background: var(--error-bg); border-color: color-mix(in srgb, var(--error) 45%, transparent); }
.alert.warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.alert .ico { font-size: 1.2rem; line-height: 1.3; }
.alert .title { font-weight: 700; }
.alert .desc { color: var(--muted); font-size: 0.9rem; }
.all-good {
  display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px;
  background: var(--ok-bg); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); font-weight: 600;
}

/* ---------- sections & cards ---------- */
.section-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; font-size: 1.15rem; font-weight: 700; }
.section-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(to left, transparent, var(--border-strong)); }

.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid.two { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .grid.three { grid-template-columns: repeat(3, 1fr); } .grid.two-wide { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 760px) and (max-width: 1099px) { .grid.three { grid-template-columns: repeat(2, 1fr); } }

.card {
  position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow), var(--glow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  min-width: 0;
}
.card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(135deg, rgba(57, 208, 255, 0.08), transparent 40%, rgba(167, 123, 255, 0.07));
}
.card.sev-error { border-color: color-mix(in srgb, var(--error) 55%, transparent); }
.card.sev-warn { border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.card h3 { margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head .sub { color: var(--muted); font-size: 0.85rem; }
.empty { color: var(--muted); font-size: 0.92rem; padding: 6px 0; }

/* ---------- status pill ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem;
  font-weight: 600; white-space: nowrap; border: 1px solid transparent;
}
.pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-bg); }
.pill.warn, .pill.starting { color: var(--warn); background: var(--warn-bg); }
.pill.error, .pill.down, .pill.degraded, .pill.restarting { color: var(--error); background: var(--error-bg); }
.pill.unknown, .pill.empty { color: var(--unknown); background: rgba(138, 163, 199, 0.12); }
.pill.busy { color: var(--busy); background: rgba(122, 167, 255, 0.12); }
.pill.error::before, .pill.down::before, .pill.degraded::before { animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .pill::before { animation: none !important; } }

/* ---------- project card ---------- */
.project .icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; flex: none;
  background: linear-gradient(135deg, rgba(57, 208, 255, 0.2), rgba(167, 123, 255, 0.2)); border: 1px solid var(--border);
}
.project .title-row { display: flex; gap: 10px; align-items: center; min-width: 0; }
.project .title-row > div { min-width: 0; }
.project h3 { overflow-wrap: anywhere; }
.domains { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.domain {
  direction: ltr; font-size: 0.8rem; padding: 3px 9px; border-radius: 8px; border: 1px solid var(--border);
  background: rgba(57, 208, 255, 0.06); overflow-wrap: anywhere;
}
.components { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.comp {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 12px;
  background: rgba(127, 160, 210, 0.06); border: 1px solid transparent;
}
.comp.sev { border-color: color-mix(in srgb, var(--error) 40%, transparent); background: var(--error-bg); }
.comp .nm { font-weight: 600; overflow-wrap: anywhere; }
.comp .tp { color: var(--muted); font-size: 0.78rem; }
.comp .kids { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.comp .kid { font-size: 0.72rem; padding: 1px 7px; border-radius: 6px; direction: ltr; }
.comp .kid.ok { color: var(--ok); background: var(--ok-bg); }
.comp .kid.bad { color: var(--error); background: var(--error-bg); }
.comp .kid.mid { color: var(--warn); background: var(--warn-bg); }

.updates { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 10px; }
.updates h4 { margin: 0 0 6px; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.updates ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 5px; }
.updates li { font-size: 0.85rem; display: flex; gap: 8px; align-items: baseline; }
.updates .when { color: var(--muted); white-space: nowrap; font-size: 0.78rem; }
.updates .msg { overflow-wrap: anywhere; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; transform: translateY(-1px); }
.dot.ok { background: var(--ok); } .dot.error { background: var(--error); } .dot.busy { background: var(--busy); } .dot.unknown { background: var(--unknown); }

.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; font-size: 0.88rem;
  font-weight: 600; border: 1px solid var(--border); background: rgba(57, 208, 255, 0.07); cursor: pointer; color: var(--text);
}
.btn:hover { border-color: var(--border-strong); text-decoration: none; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border: 0; }
.btn[disabled] { opacity: 0.55; cursor: progress; }

.preview { margin-top: 12px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: #fff; aspect-ratio: 16 / 10; position: relative; }
.preview iframe { width: 250%; height: 250%; border: 0; transform: scale(0.4); transform-origin: top right; pointer-events: none; }

/* ---------- resources ---------- */
.meters { display: grid; gap: 14px; }
.meter .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 0.92rem; }
.meter .val { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.bar { height: 10px; border-radius: 999px; background: rgba(127, 160, 210, 0.15); overflow: hidden; margin-top: 6px; position: relative; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width 0.6s; }
[dir='rtl'] .bar > span { margin-inline-start: 0; }
.bar .tick { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--warn); opacity: 0.8; }
.meter.warn .bar > span { background: var(--warn); }
.meter.error .bar > span { background: var(--error); }
.meter.warn .val { color: var(--warn); }
.meter.error .val { color: var(--error); }

/* ---------- tables / lists ---------- */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 0.9rem; }
.list li:last-child { border-bottom: 0; }
.list .k { overflow-wrap: anywhere; min-width: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 0.92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.note { font-size: 0.88rem; color: var(--muted); background: rgba(127, 160, 210, 0.08); padding: 10px 12px; border-radius: 12px; margin-top: 10px; }
.note code, .kv code { direction: ltr; unicode-bidi: isolate; font-size: 0.85em; background: rgba(127, 160, 210, 0.15); padding: 1px 5px; border-radius: 5px; }

.links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .links { grid-template-columns: repeat(3, 1fr); } }
.links a {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; border: 1px solid var(--border);
  background: rgba(57, 208, 255, 0.05); color: var(--text); font-weight: 600;
}
.links a:hover { border-color: var(--border-strong); text-decoration: none; }
.links .li { font-size: 1.3rem; }
.links .ls { display: block; font-size: 0.75rem; color: var(--muted); font-weight: 400; }

footer { margin-top: 32px; color: var(--muted); font-size: 0.8rem; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }

/* ---------- loading ---------- */
.skeleton { height: 140px; border-radius: var(--radius); background: linear-gradient(90deg, var(--panel), rgba(57, 208, 255, 0.1), var(--panel)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border: 1px solid var(--border); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- auth pages ---------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { margin: 6px 0 4px; font-size: 1.6rem; }
.field { display: grid; gap: 6px; margin-top: 14px; }
.field label { font-weight: 600; font-size: 0.92rem; }
.field input {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--bg-2);
  color: var(--text); font: inherit; font-size: 1rem;
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field input.code { direction: ltr; text-align: center; letter-spacing: 0.4em; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.form-error { color: var(--error); font-weight: 600; margin-top: 12px; min-height: 1.4em; }
.auth-card .btn.primary { width: 100%; justify-content: center; padding: 12px; font-size: 1rem; margin-top: 18px; }
.qr { background: #fff; border-radius: 12px; padding: 8px; width: 220px; max-width: 100%; margin: 10px auto; }
.qr svg { display: block; width: 100%; height: auto; }
.env-box { direction: ltr; text-align: left; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.78rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px; overflow-wrap: anywhere; white-space: pre-wrap; }
ol.steps { padding-inline-start: 20px; display: grid; gap: 8px; }
.mt4 { margin-top: 4px; }
.mt10 { margin-top: 10px; }
.err { color: var(--error); }
.minw0 { min-width: 0; }
