:root {
  --bg: #070910;
  --surface: rgba(17, 21, 34, .78);
  --surface-strong: #121725;
  --line: rgba(255, 255, 255, .09);
  --muted: #8f98ad;
  --text: #f4f7ff;
  --blue: #6b8cff;
  --cyan: #49d5ff;
  --green: #42e5a2;
  --red: #ff6d7a;
  --radius: 24px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  background:
    radial-gradient(circle at 50% -20%, rgba(84, 112, 255, .18), transparent 42%),
    linear-gradient(145deg, #070910, #090d18 58%, #06080e);
  overflow-x: hidden;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.hidden { display: none !important; }
.ambient { position: fixed; width: 420px; height: 420px; filter: blur(110px); opacity: .12; border-radius: 50%; pointer-events: none; }
.ambient-a { top: -160px; left: 28%; background: var(--blue); }
.ambient-b { right: -180px; bottom: -180px; background: var(--cyan); }

.language-switcher { position: fixed; top: 22px; right: 24px; z-index: 50; }
.language-toggle {
  min-width: 86px; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 14px;
  display: flex; align-items: center; justify-content: center; gap: 8px; color: #dce4f7;
  background: rgba(14, 18, 29, .82); box-shadow: 0 12px 38px rgba(0, 0, 0, .28), inset 0 1px rgba(255, 255, 255, .04);
  backdrop-filter: blur(22px); transition: border-color .2s, background .2s, transform .2s;
}
.language-toggle:hover, .language-switcher.open .language-toggle {
  border-color: rgba(107, 140, 255, .5); background: rgba(24, 30, 48, .9); transform: translateY(-1px);
}
.language-globe { width: 19px; height: 19px; border: 1px solid rgba(128, 155, 255, .72); border-radius: 50%; display: grid; place-items: center; color: var(--cyan); font-size: 12px; }
.language-toggle b { font-size: 11px; letter-spacing: .09em; }
.language-chevron { color: var(--muted); font-size: 14px; transition: transform .2s; }
.language-switcher.open .language-chevron { transform: rotate(180deg); }
.language-menu {
  position: absolute; top: calc(100% + 9px); right: 0; width: 190px; padding: 7px;
  border: 1px solid var(--line); border-radius: 17px; background: rgba(13, 17, 28, .96);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .46); backdrop-filter: blur(28px);
  opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-6px) scale(.98);
  transform-origin: top right; transition: opacity .18s, visibility .18s, transform .18s;
}
.language-switcher.open .language-menu { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
.language-menu button {
  width: 100%; min-height: 42px; padding: 0 10px; border-radius: 11px; display: grid;
  grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; text-align: left;
  color: #cbd3e5; background: transparent; font-size: 12px;
}
.language-menu button:hover { background: rgba(107, 140, 255, .1); color: var(--text); }
.language-menu button.selected { background: rgba(107, 140, 255, .14); color: var(--text); }
.language-code { color: #8fa7ff; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.language-menu i { color: var(--green); font-style: normal; opacity: 0; }
.language-menu button.selected i { opacity: 1; }

.brand { display: flex; align-items: center; gap: 13px; }
.brand strong { display: block; font-size: 17px; letter-spacing: -.03em; }
.brand small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; letter-spacing: .08em; text-transform: uppercase; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(114, 146, 255, .55);
  border-radius: 12px; background: linear-gradient(145deg, rgba(107, 140, 255, .2), rgba(73, 213, 255, .03));
  box-shadow: inset 0 0 18px rgba(107, 140, 255, .17), 0 0 24px rgba(107, 140, 255, .1);
}
.brand-mark::before, .brand-mark i { content: ""; width: 13px; height: 13px; border: 2px solid #8ca5ff; border-radius: 4px; transform: rotate(45deg); }
.brand-mark i { position: absolute; width: 7px; height: 7px; border-color: var(--cyan); }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: min(100%, 460px); padding: 30px; border: 1px solid var(--line); border-radius: 30px;
  background: linear-gradient(160deg, rgba(22, 27, 44, .9), rgba(11, 14, 24, .78));
  box-shadow: 0 30px 90px rgba(0,0,0,.44), inset 0 1px rgba(255,255,255,.05);
  backdrop-filter: blur(30px);
}
.auth-card > .brand { margin-bottom: 56px; }
.auth-copy { margin-bottom: 14px; }
.auth-copy h1 { font-size: clamp(38px, 8vw, 54px); line-height: .98; letter-spacing: -.055em; margin: 12px 0 18px; }
.auth-copy h1 span, .hero-panel h3 span { color: transparent; background: linear-gradient(90deg, #90a6ff, #56dbff); background-clip: text; }
.auth-copy p, .hero-panel p, .panel p, .section-head p, dialog p { color: var(--muted); line-height: 1.6; margin: 0; }
.eyebrow { color: #9cb0ff; font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .15em; }

.stack { display: grid; gap: 16px; }
.stack.compact { gap: 13px; }
label { color: #bec6d7; font-size: 12px; font-weight: 650; display: grid; gap: 8px; }
input, select {
  width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 14px;
  padding: 0 14px; color: var(--text); background: rgba(5, 8, 15, .62); outline: none;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
input:focus, select:focus { border-color: rgba(107, 140, 255, .8); box-shadow: 0 0 0 4px rgba(107, 140, 255, .12); }
select option { background: #101522; }
button { border: 0; cursor: pointer; }
.primary, .ghost, .danger {
  min-height: 46px; border-radius: 14px; padding: 0 17px; font-weight: 720; transition: transform .18s, filter .18s, border-color .18s;
}
.primary { color: #07101c; background: linear-gradient(115deg, #849bff, #55d9ff); box-shadow: 0 12px 34px rgba(75, 129, 255, .22); }
.primary:hover, .ghost:hover, .danger:hover { transform: translateY(-1px); filter: brightness(1.08); }
.primary:disabled, .ghost:disabled, .danger:disabled { opacity: .42; cursor: not-allowed; transform: none; filter: none; }
.wide { width: 100%; }
.primary.wide { display: flex; align-items: center; justify-content: space-between; }
.primary.wide b { font-size: 20px; }
.ghost { color: #cbd2e2; background: rgba(255,255,255,.035); border: 1px solid var(--line); }
.danger { color: #ffd9dc; background: linear-gradient(135deg, rgba(255, 89, 107, .2), rgba(255, 109, 122, .1)); border: 1px solid rgba(255,109,122,.28); }
.icon-danger { width: 42px; min-width: 42px; padding: 0; color: #ff9ca5; }
.text-link { color: #8aa5ff; font-size: 12px; text-decoration: none; }
.form-error { color: var(--red); font-size: 13px; min-height: 18px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
aside {
  position: sticky; top: 0; height: 100vh; padding: 26px 20px; border-right: 1px solid var(--line);
  background: rgba(8, 11, 18, .7); backdrop-filter: blur(24px); display: flex; flex-direction: column;
}
aside .brand { padding: 0 8px; }
nav { display: grid; gap: 8px; margin-top: 54px; }
.nav-item {
  min-height: 46px; padding: 0 13px; border-radius: 13px; text-align: left; color: var(--muted);
  background: transparent; display: flex; align-items: center; gap: 12px; font-weight: 650;
}
.nav-item > span:first-child { font-size: 18px; }
.nav-item > span:last-child { font-size: inherit; }
.nav-item.active { color: var(--text); background: linear-gradient(90deg, rgba(107, 140, 255, .16), rgba(107, 140, 255, .03)); box-shadow: inset 2px 0 #7795ff; }
.aside-foot { margin-top: auto; display: grid; gap: 12px; }
.network-pill { padding: 13px; border: 1px solid var(--line); border-radius: 14px; display: grid; grid-template-columns: 8px 1fr auto; gap: 9px; align-items: center; font-size: 11px; }
.network-pill i { width: 8px; height: 8px; border-radius: 50%; background: #758098; box-shadow: 0 0 0 4px rgba(117,128,152,.1); }
.network-pill b { color: var(--muted); font-weight: 600; }
.network-pill.online i { background: var(--green); box-shadow: 0 0 0 4px rgba(66,229,162,.1), 0 0 14px rgba(66,229,162,.5); }
.network-pill.online b { color: var(--green); }

.content { min-width: 0; padding: 0 42px 60px; }
header { height: 96px; padding-right: 92px; display: flex; align-items: center; justify-content: space-between; }
header h2 { font-size: 22px; margin: 5px 0 0; letter-spacing: -.03em; }
.profile { display: flex; align-items: center; gap: 11px; }
.profile > span { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, #5878e8, #4ca9cf); font-size: 12px; font-weight: 800; }
.profile strong, .profile small { display: block; font-size: 12px; }
.profile small { color: var(--muted); margin-top: 3px; }
.view { max-width: 1220px; margin: 0 auto; }

.hero-panel {
  min-height: 245px; border: 1px solid var(--line); border-radius: 28px; padding: 38px 42px;
  background:
    radial-gradient(circle at 83% 40%, rgba(91, 126, 255, .2), transparent 25%),
    linear-gradient(130deg, rgba(25,31,51,.9), rgba(11,15,25,.82));
  display: flex; align-items: center; justify-content: space-between; overflow: hidden; position: relative;
}
.hero-panel::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(90deg, transparent, #000); }
.hero-panel > div:first-child { max-width: 580px; position: relative; z-index: 1; }
.hero-panel h3 { font-size: clamp(35px, 5vw, 53px); line-height: .98; letter-spacing: -.055em; margin: 13px 0 19px; }
.hero-orbit { width: 190px; height: 190px; border: 1px solid rgba(123,151,255,.22); border-radius: 50%; display: grid; place-items: center; position: relative; margin-right: 45px; box-shadow: inset 0 0 55px rgba(83,114,237,.08); }
.hero-orbit::before, .hero-orbit::after { content: ""; position: absolute; border: 1px solid rgba(90,213,255,.18); border-radius: 50%; inset: 25px; }
.hero-orbit::after { inset: 54px; }
.hero-orbit i { width: 55px; height: 55px; border: 1px solid #7796ff; transform: rotate(45deg); border-radius: 15px; background: rgba(107,140,255,.14); box-shadow: 0 0 44px rgba(91,129,255,.4); }
.hero-orbit b, .hero-orbit em { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 16px var(--cyan); }
.hero-orbit b { top: 26px; right: 31px; }.hero-orbit em { bottom: 43px; left: 13px; }

.section-head { display: flex; justify-content: space-between; align-items: end; margin: 38px 0 18px; }
.section-head h3 { font-size: 22px; letter-spacing: -.03em; margin: 5px 0; }
.section-head .ghost { min-height: 38px; font-size: 12px; }
.workspace-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.workspace-card, .panel {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  box-shadow: inset 0 1px rgba(255,255,255,.035); backdrop-filter: blur(20px);
}
.workspace-card { padding: 21px; min-height: 245px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.workspace-card::after { content: ""; position: absolute; width: 150px; height: 150px; border-radius: 50%; right: -65px; top: -70px; background: rgba(107,140,255,.08); filter: blur(25px); }
.card-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.vm-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: rgba(107,140,255,.1); border: 1px solid rgba(107,140,255,.25); color: #9db0ff; }
.state { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.state i { width: 7px; height: 7px; border-radius: 50%; background: #69748b; }
.state.ready i, .state.inuse i { background: var(--green); box-shadow: 0 0 10px rgba(66,229,162,.7); }
.state.starting i { background: #ffc86d; animation: pulse 1.2s infinite; }
.state.error i { background: var(--red); }
@keyframes pulse { 50% { opacity: .35; } }
.workspace-card h4 { font-size: 17px; margin: 22px 0 5px; letter-spacing: -.025em; }
.workspace-card .address { color: var(--muted); font-size: 12px; min-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-card .metrics { display: flex; gap: 8px; margin: 17px 0; }
.metric { padding: 6px 9px; border-radius: 9px; background: rgba(255,255,255,.035); color: #aab3c6; font-size: 10px; }
.card-actions { margin-top: auto; display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.card-actions .primary, .card-actions .ghost { min-height: 40px; font-size: 12px; }
.invite-link { display: block; color: #83d6ff; font-size: 11px; margin-top: 8px; text-decoration: none; }
.empty-state { grid-column: 1/-1; padding: 48px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); }

.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel { padding: 24px; }
.span-two { grid-column: 1/-1; }
.panel-title { display: flex; align-items: start; justify-content: space-between; margin-bottom: 22px; }
.panel h4 { margin: 0 0 6px; font-size: 17px; }
.panel-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #91a7ff; background: rgba(107,140,255,.1); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { display: flex; align-items: center; gap: 18px; }
.status-chip { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 10px; color: var(--muted); }
.status-chip.online { color: var(--green); border-color: rgba(66,229,162,.25); background: rgba(66,229,162,.06); }
.status-chip.disabled { color: #ff9ca5; border-color: rgba(255,109,122,.25); background: rgba(255,109,122,.06); }

.user-management-list { display: grid; gap: 10px; }
.user-row {
  min-height: 76px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 17px;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center;
  background: rgba(5, 8, 15, .38);
}
.user-avatar { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #dce5ff; background: linear-gradient(135deg, rgba(107,140,255,.42), rgba(73,213,255,.22)); border: 1px solid rgba(107,140,255,.28); }
.user-copy { min-width: 0; }
.user-copy strong { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.user-copy small { display: block; color: var(--muted); margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-badge { padding: 4px 7px; border-radius: 999px; color: #aebdff; background: rgba(107,140,255,.11); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.user-row-actions { display: flex; gap: 8px; }
.user-row-actions button { min-height: 38px; padding: 0 12px; font-size: 11px; border-radius: 11px; }
.user-empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 17px; }

dialog {
  width: min(92vw, 580px); color: var(--text); border: 1px solid var(--line); border-radius: 26px;
  padding: 26px; background: rgba(13,17,28,.96); box-shadow: 0 30px 100px rgba(0,0,0,.65); backdrop-filter: blur(30px);
}
dialog::backdrop { background: rgba(2,4,9,.74); backdrop-filter: blur(8px); }
.dialog-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: 22px; }
.dialog-head h3 { margin: 6px 0 0; font-size: 25px; }
.icon-button { width: 36px; height: 36px; border-radius: 11px; background: rgba(255,255,255,.05); font-size: 20px; }
.credential { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: rgba(4,7,13,.5); }
.credential small { grid-column: 1/-1; color: var(--muted); }
.credential strong { overflow: hidden; text-overflow: ellipsis; }
.credential button { color: #8ca7ff; background: transparent; font-size: 11px; }
.secret { letter-spacing: .08em; }
.hint { font-size: 11px; }
.confirm-dialog { width: min(92vw, 450px); text-align: center; }
.confirm-symbol {
  width: 52px; height: 52px; margin: 0 auto 18px; border-radius: 17px; display: grid; place-items: center;
  color: #ffb1b8; font-size: 24px; font-weight: 800; border: 1px solid rgba(255,109,122,.28);
  background: radial-gradient(circle at 35% 25%, rgba(255,109,122,.3), rgba(255,109,122,.08));
  box-shadow: 0 14px 40px rgba(255, 73, 94, .12);
}
.confirm-dialog h3 { margin: 0 0 10px; font-size: 23px; letter-spacing: -.035em; }
.confirm-dialog p { white-space: pre-line; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: 380px; padding: 14px 17px; border: 1px solid var(--line); border-radius: 14px; background: #151b2a; box-shadow: 0 14px 50px rgba(0,0,0,.4); opacity: 0; transform: translateY(15px); pointer-events: none; transition: .25s; font-size: 13px; z-index: 30; }
.toast.show { opacity: 1; transform: none; }
.toast.error { border-color: rgba(255,109,122,.3); color: #ff9ca5; }

@media (max-width: 1050px) {
  .workspace-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hero-orbit { margin-right: 0; transform: scale(.8); }
}
@media (max-width: 760px) {
  .language-switcher { top: 14px; right: 14px; }
  .language-toggle { min-width: 76px; height: 40px; }
  .app-shell { display: block; }
  aside { position: fixed; z-index: 10; bottom: 0; top: auto; width: 100%; height: 70px; padding: 8px 14px; border: 1px solid var(--line); flex-direction: row; align-items: center; }
  aside .brand, .aside-foot { display: none; }
  nav { width: 100%; margin: 0; display: flex; justify-content: center; }
  .nav-item { min-height: 52px; justify-content: center; flex: 1; max-width: 220px; }
  .content { padding: 0 16px 100px; }
  header { height: 82px; padding-right: 82px; }
  .hero-panel { padding: 28px 24px; min-height: 220px; }
  .hero-orbit { display: none; }
  .workspace-grid, .admin-grid, .form-grid { grid-template-columns: 1fr; }
  .span-two { grid-column: auto; }
  .profile div { display: none; }
  .user-row { grid-template-columns: auto minmax(0, 1fr); }
  .user-row > .status-chip { justify-self: start; grid-column: 2; }
  .user-row-actions { grid-column: 1/-1; }
  .user-row-actions button { flex: 1; }
}
@media (max-width: 470px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 24px; border-radius: 24px; }
  .hero-panel h3 { font-size: 34px; }
  .credential { grid-template-columns: 1fr auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
