/* ============================================================
   cloud.css — MatrixCloud — PREMIUM enterprise control plane
   Emerald-on-black, glassy panels, matrix rain, radial glow.
   ============================================================ */

:root {
  --bg:       #050807;
  --bg-2:     #08110d;
  --panel:    rgba(10, 21, 16, 0.80);
  --panel-2:  #0a1510;
  --raised:   rgba(0, 255, 136, 0.05);
  --inset:    rgba(0, 0, 0, 0.40);
  --side:     rgba(0, 0, 0, 0.28);
  --topbar:   rgba(0, 0, 0, 0.45);

  --line:     rgba(0, 255, 136, 0.12);
  --line-2:   rgba(0, 255, 136, 0.18);
  --line-3:   rgba(0, 255, 136, 0.30);

  --ink:      #ecfdf5;
  --ink-2:    rgba(236, 253, 245, 0.64);
  --ink-3:    rgba(236, 253, 245, 0.46);
  --ink-4:    rgba(236, 253, 245, 0.30);

  --acc:      #00ff88;
  --acc-2:    #6ef0b0;
  --acc-dim:  #10b981;
  --acc-soft: rgba(0, 255, 136, 0.08);
  --acc-line: rgba(0, 255, 136, 0.28);

  --blue:     #5cc8ff;
  --blue-soft: rgba(92, 200, 255, 0.10);
  --amber:    #d9f99d;
  --amber-soft: rgba(217, 249, 157, 0.10);
  --lime:     #bef264;
  --red:      #fb7185;
  --red-soft: rgba(251, 113, 133, 0.10);
  --violet:   #c4b5fd;

  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;

  --font: "Inter Tight", "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --top-h: 56px;
  --side-w: 264px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; }
::selection { background: var(--acc); color: #03140c; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,255,136,0.14); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,255,136,0.26); background-clip: padding-box; }

.mono { font-family: var(--mono); }
.eyebrow { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.26em; text-transform: uppercase; color: var(--acc-2); opacity: 0.72; margin: 0; }

/* ---------- atmospheric background ---------- */
#mx-rain { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.07; }
.mx-glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(circle at 32% -4%, rgba(0,255,136,0.16), transparent 34%),
    radial-gradient(circle at 86% 14%, rgba(92,255,182,0.08), transparent 30%);
}
#cloud-root { position: relative; z-index: 1; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 40; height: var(--top-h);
  display: flex; align-items: center; gap: 14px; padding: 0 18px;
  background: var(--topbar); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--acc-line); background: var(--acc-soft); color: var(--acc); box-shadow: 0 0 26px rgba(0,255,136,0.14); }
.brand .nm { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.brand .tag { font-family: var(--mono); font-size: 9.5px; color: var(--acc-2); opacity: 0.7; border: 1px solid var(--line-2);
  padding: 2px 7px; border-radius: 6px; letter-spacing: 0.16em; text-transform: uppercase; }

.switcher { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: rgba(0,0,0,0.3); font-size: 13px; color: var(--ink-2); transition: all .14s; }
.switcher:hover { border-color: var(--line-3); color: var(--ink); }
.switcher .av { width: 19px; height: 19px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: #03140c; }
.switcher .chev { color: var(--ink-4); }
.sep { width: 1px; height: 24px; background: var(--line-2); }

.top .grow { flex: 1; }
.topsearch { display: flex; align-items: center; gap: 9px; height: 36px; width: 380px; max-width: 32vw;
  padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: rgba(0,0,0,0.3); color: var(--ink-3); }
.topsearch input { border: none; outline: none; background: transparent; color: var(--ink); flex: 1; min-width: 0; font-size: 13px; }
.topsearch kbd { font-family: var(--mono); font-size: 10.5px; color: var(--ink-4); border: 1px solid var(--line-2); border-radius: 5px; padding: 0 5px; }

.iconbtn { width: 36px; height: 36px; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-3); border: 1px solid transparent; transition: all .14s; }
.iconbtn:hover { background: var(--acc-soft); color: var(--acc-2); border-color: var(--line-2); }
.user-av { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--acc), var(--acc-dim));
  display: flex; align-items: center; justify-content: center; color: #03140c; font-weight: 800; font-size: 12px; }

/* ---------- layout ---------- */
.shell { display: flex; min-height: calc(100vh - var(--top-h)); }
.side { width: var(--side-w); flex-shrink: 0; background: var(--side); border-right: 1px solid var(--line);
  padding: 16px 12px; display: flex; flex-direction: column; position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h));
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.navlabel { font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-4); padding: 16px 10px 7px; }
.navitem { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); width: 100%;
  font-size: 13.5px; font-weight: 500; color: var(--ink-2); transition: all .13s; text-align: left; border: 1px solid transparent; }
.navitem:hover { background: rgba(0,255,136,0.05); color: var(--ink); }
.navitem.active { background: var(--acc-soft); color: var(--ink); border-color: var(--line-2); }
.navitem.active .i { color: var(--acc); }
.navitem .i { color: var(--acc); opacity: 0.8; display: inline-flex; flex-shrink: 0; }
.navitem .tag { margin-left: auto; display: grid; place-items: center; height: 20px; min-width: 20px; padding: 0 6px;
  border-radius: 99px; font-family: var(--mono); font-size: 10.5px; background: rgba(0,255,136,0.10); color: var(--acc-2); }
.side-foot { margin-top: auto; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(0,0,0,0.25); }

.user-row { display: flex; align-items: center; gap: 11px; width: 100%; margin-top: 10px; padding: 10px 11px;
  border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(0,0,0,0.25); transition: all .14s; }
.user-row:hover, .user-row.open { background: var(--acc-soft); border-color: var(--line-2); }
.user-row .ua { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--acc), var(--acc-dim)); color: #03140c; font-weight: 800; font-size: 13px; }

.main { flex: 1; min-width: 0; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 30px 32px 56px; }

/* ---------- page header (premium hero) ---------- */
.phead { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; }
.phead h1 { margin: 9px 0 0; font-size: 30px; font-weight: 600; letter-spacing: -0.04em; line-height: 1.04; }
.phead p { margin: 12px 0 0; font-size: 14px; line-height: 1.7; color: var(--ink-3); max-width: 720px; }
.hero h1 { font-size: clamp(30px, 4vw, 50px); }

/* ---------- primitives ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 24px 60px rgba(0,0,0,0.30); }
.card-pad { padding: 20px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.card-h .t { font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--acc-2); opacity: 0.8; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px;
  border-radius: var(--r-sm); font-size: 13.5px; font-weight: 600; transition: all .14s; white-space: nowrap; }
.btn-primary { background: var(--acc); color: #03140c; box-shadow: 0 0 24px rgba(0,255,136,0.18); }
.btn-primary:hover { background: var(--acc-2); }
.btn-ghost { border: 1px solid var(--line-2); color: var(--ink); background: rgba(0,0,0,0.2); }
.btn-ghost:hover { background: var(--acc-soft); border-color: var(--line-3); }
.btn-sm { height: 34px; padding: 0 13px; font-size: 12.5px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.chip { display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 11px; border-radius: 99px;
  font-size: 11px; font-weight: 500; font-family: var(--mono); white-space: nowrap;
  border: 1px solid var(--line-2); color: var(--ink-2); background: rgba(0,0,0,0.2); }
.chip.green { color: var(--acc-2); border-color: var(--acc-line); background: var(--acc-soft); }
.chip.blue { color: var(--blue); border-color: rgba(92,200,255,0.28); background: var(--blue-soft); }
.chip.amber { color: var(--lime); border-color: rgba(190,242,100,0.28); background: var(--amber-soft); }
.chip.red { color: var(--red); border-color: rgba(251,113,133,0.28); background: var(--red-soft); }
.chip.violet { color: var(--violet); border-color: rgba(196,181,253,0.28); background: rgba(196,181,253,0.1); }

.dot { width: 7px; height: 7px; border-radius: 99px; flex-shrink: 0; }
.dot.green { background: var(--acc); box-shadow: 0 0 10px var(--acc); }
.dot.amber { background: var(--lime); box-shadow: 0 0 10px var(--lime); }
.dot.red { background: var(--red); box-shadow: 0 0 10px var(--red); }
.dot.blue { background: var(--blue); box-shadow: 0 0 10px var(--blue); }
.dot.gray { background: var(--ink-4); }
.pulse { position: relative; }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 99px; background: inherit; animation: cloudPing 1.8s var(--ease) infinite; }
@keyframes cloudPing { 0% { transform: scale(1); opacity: .6; } 80%,100% { transform: scale(2.6); opacity: 0; } }

/* metric */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.metric { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 24px 60px rgba(0,0,0,0.25); transition: border-color .15s; }
.metric:hover { border-color: var(--line-2); }
.metric .ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  border: 1px solid var(--line-2); background: var(--acc-soft); color: var(--acc); }
.metric .lab { font-size: 12.5px; color: var(--ink-3); margin-top: 18px; }
.metric .val { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin-top: 5px; }
.metric .cap { font-family: var(--mono); font-size: 11px; color: var(--ink-4); margin-top: 7px; }

/* table */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-4); padding: 12px 20px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.row:hover td { background: rgba(0,255,136,0.03); }
.tbl .nm { color: var(--ink); font-weight: 600; }

/* sparkline bars */
.spark { display: flex; align-items: flex-end; gap: 3px; height: 40px; }
.spark span { flex: 1; background: linear-gradient(180deg, var(--acc), var(--acc-dim)); border-radius: 2px; opacity: .85; min-height: 3px; }

/* progress */
.bar { height: 6px; border-radius: 99px; background: var(--inset); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; }
.bar > span.green { background: linear-gradient(90deg, var(--acc-dim), var(--acc)); }
.bar > span.blue { background: linear-gradient(90deg, #2f7fb0, var(--blue)); }
.bar > span.amber { background: linear-gradient(90deg, #8faf3a, var(--lime)); }

/* log console */
.logwin { background: rgba(0,0,0,0.45); border: 1px solid var(--line); border-radius: var(--r-md); font-family: var(--mono);
  font-size: 12px; line-height: 1.75; padding: 15px 17px; overflow-y: auto; }

/* steps */
.step { display: flex; gap: 13px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: none; }
.step .num { width: 24px; height: 24px; border-radius: 99px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; font-family: var(--mono); border: 1px solid var(--line-3); color: var(--ink-3); }
.step.done .num { background: var(--acc); border-color: var(--acc); color: #03140c; }
.step.active .num { border-color: var(--acc); color: var(--acc); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.rise { animation: rise .45s var(--ease) both; }
@keyframes blink { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }
.cur { display: inline-block; width: .5em; height: 1em; background: var(--acc); vertical-align: text-bottom; animation: blink 1s steps(1) infinite; }

.menu-btn { display: none; }
@media (max-width: 900px) {
  .auth-grid { grid-template-columns: 1fr !important; }
  .auth-hero { display: none !important; }
  .auth-form { border-left: none !important; }
}
@media (max-width: 520px) { .auth-feats { grid-template-columns: 1fr !important; } }

/* responsive */
@media (max-width: 1080px) { .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 860px) {
  .side { position: fixed; left: 0; top: var(--top-h); z-index: 50; transform: translateX(-100%); transition: transform .2s var(--ease); }
  .side.open { transform: translateX(0); box-shadow: 0 0 60px rgba(0,0,0,0.7); }
  .side-scrim { position: fixed; inset: var(--top-h) 0 0 0; z-index: 49; background: rgba(3,6,5,0.6); backdrop-filter: blur(3px); }
  .menu-btn { display: inline-flex; }
  .topsearch { display: none; }
  .wrap { padding: 22px 16px 44px; }
  .ov-grid { grid-template-columns: minmax(0,1fr) !important; }
  .sbx-grid { grid-template-columns: minmax(0,1fr) !important; }
  .card { overflow-x: auto !important; }
  .tbl { min-width: 560px; }
  .phead h1 { font-size: 25px; }
}
@media (max-width: 560px) {
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 11px; }
  .metric { padding: 15px; }
  .metric .val { font-size: 21px; }
  .hide-sm { display: none !important; }
  .env-switch-lab { display: none; }
  .top { gap: 9px; padding: 0 13px; }
}
@supports (padding: env(safe-area-inset-bottom)) {
  @media (max-width: 860px) { .wrap { padding-bottom: calc(44px + env(safe-area-inset-bottom)); } }
}

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
