:root {
  color-scheme: dark;
  --bg: #080d12;
  --bg-soft: #0c131b;
  --panel: rgba(15, 24, 34, .88);
  --panel-solid: #101a24;
  --line: rgba(160, 191, 211, .13);
  --line-strong: rgba(35, 217, 245, .28);
  --text: #edf7fb;
  --muted: #8094a3;
  --cyan: #23d9f5;
  --cyan-soft: rgba(35, 217, 245, .12);
  --green: #4ce59a;
  --green-soft: rgba(76, 229, 154, .12);
  --amber: #f7bd55;
  --red: #ff6177;
  --purple: #a78bfa;
  --radius: 18px;
  --shadow: 0 24px 80px rgba(0, 0, 0, .28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 70% -20%, #102738 0, transparent 42%), var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.hidden { display: none !important; }
.ambient { position: fixed; border-radius: 50%; filter: blur(100px); opacity: .12; pointer-events: none; }
.ambient-one { width: 440px; height: 440px; background: var(--cyan); top: -220px; right: 12%; }
.ambient-two { width: 300px; height: 300px; background: var(--green); bottom: -180px; left: 25%; }
.eyebrow { margin: 0 0 8px; color: var(--cyan); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.muted-text { color: var(--muted); font-size: 12px; }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.auth-card { position: relative; width: min(440px, 100%); padding: 46px; text-align: center; border: 1px solid var(--line); border-radius: 26px; background: linear-gradient(150deg, rgba(17, 29, 40, .96), rgba(9, 15, 22, .96)); box-shadow: var(--shadow); overflow: hidden; }
.auth-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 20%, rgba(35, 217, 245, .045), transparent 70%); pointer-events: none; }
.auth-card h1 { margin: 14px 0 8px; font-size: 32px; letter-spacing: -.04em; }
.auth-card h1 span { color: var(--cyan); font-weight: 500; }
.auth-description { margin: 0 auto 30px; max-width: 330px; color: var(--muted); line-height: 1.55; }
.brand-mark { position: relative; width: 38px; height: 38px; border: 5px solid var(--cyan); border-right-color: transparent; border-radius: 50%; transform: rotate(-12deg); box-shadow: 0 0 22px rgba(35, 217, 245, .2); }
.brand-mark span { position: absolute; width: 20px; height: 10px; left: 7px; top: 8px; border-left: 4px solid var(--green); border-bottom: 4px solid var(--green); transform: rotate(-45deg); }
.brand-mark.large { width: 58px; height: 58px; margin: 0 auto; border-width: 7px; }
.brand-mark.large span { width: 28px; height: 14px; left: 11px; top: 13px; border-width: 0 0 5px 5px; }
.auth-form { position: relative; display: grid; gap: 10px; text-align: left; }
.auth-form label { margin-top: 5px; color: #b8c7d1; font-size: 12px; font-weight: 700; }
input, select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 11px; background: #0a1118; color: var(--text); padding: 0 13px; }
input:hover, select:hover { border-color: rgba(35, 217, 245, .3); }
input:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
input.otp { height: 58px; text-align: center; font-size: 26px; font-weight: 800; letter-spacing: .35em; }
.form-message { min-height: 22px; margin: 14px 0 0; color: var(--red); font-size: 13px; }
.form-message.success { color: var(--green); }
.security-note { position: relative; margin-top: 18px; color: var(--muted); font-size: 11px; }
.security-note span { color: var(--green); margin-right: 5px; }

.button { min-height: 42px; border: 1px solid transparent; border-radius: 11px; padding: 0 17px; color: var(--text); font-weight: 750; transition: transform .15s, border-color .15s, background .15s, opacity .15s; }
.button:hover:not(:disabled), .control:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled, .control:disabled { cursor: not-allowed; opacity: .35; }
.wide { width: 100%; }
.primary { margin-top: 10px; color: #031116; background: linear-gradient(135deg, var(--cyan), #4ce5d1); box-shadow: 0 8px 28px rgba(35, 217, 245, .16); }
.secondary { color: #c8f8ff; border-color: rgba(35, 217, 245, .25); background: var(--cyan-soft); }
.ghost { border-color: var(--line); background: transparent; color: #aebfca; }
.danger { border-color: rgba(255, 97, 119, .35); background: rgba(255, 97, 119, .11); color: #ff9baa; }

.app { min-height: 100vh; display: grid; grid-template-columns: 238px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 18px 20px; background: rgba(7, 12, 17, .94); border-right: 1px solid var(--line); backdrop-filter: blur(18px); z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 32px; }
.brand strong { display: block; font-size: 17px; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 2px; color: var(--cyan); font-size: 9px; font-weight: 800; letter-spacing: .24em; }
.nav { display: grid; gap: 5px; }
.nav-item { height: 46px; display: flex; gap: 13px; align-items: center; border: 1px solid transparent; border-radius: 12px; padding: 0 14px; background: transparent; color: #8396a4; text-align: left; font-weight: 650; }
.nav-item span { width: 18px; color: #6a7f8e; font-size: 17px; text-align: center; }
.nav-item:hover { background: rgba(255,255,255,.025); color: var(--text); }
.nav-item.active { border-color: rgba(35, 217, 245, .13); background: linear-gradient(90deg, rgba(35,217,245,.12), rgba(35,217,245,.025)); color: #d9fbff; }
.nav-item.active span { color: var(--cyan); }
.sidebar-foot { margin-top: auto; display: grid; gap: 16px; }
.server-mini { display: flex; align-items: center; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.018); }
.server-mini i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }
.server-mini span { min-width: 0; }
.server-mini strong, .server-mini small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.server-mini strong { font-size: 11px; }
.server-mini small { margin-top: 3px; color: var(--muted); font-size: 10px; }

.content-shell { min-width: 0; }
.topbar { min-height: 86px; display: flex; align-items: center; gap: 18px; padding: 18px 32px; border-bottom: 1px solid var(--line); background: rgba(8, 13, 18, .73); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 15; }
.topbar h2 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.topbar .eyebrow { margin-bottom: 4px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.instance-select { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; }
.instance-select select { width: 190px; min-height: 39px; }
.icon-button, .menu-toggle { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.025); color: #b9cad4; font-size: 19px; }
.menu-toggle { display: none; }
.user-chip { display: flex; align-items: center; gap: 9px; padding-left: 5px; }
.user-chip > span { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(35,217,245,.25); border-radius: 10px; background: var(--cyan-soft); color: var(--cyan); font-weight: 800; }
.user-chip strong, .user-chip small { display: block; }
.user-chip strong { font-size: 11px; }.user-chip small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.connection-banner { padding: 9px 32px; background: rgba(255,97,119,.12); border-bottom: 1px solid rgba(255,97,119,.2); color: #ff9baa; font-size: 12px; }
.workspace { width: min(1500px, 100%); margin: 0 auto; padding: 28px 32px 44px; }
.tab { display: none; }.tab.active { display: block; animation: reveal .2s ease-out; }
@keyframes reveal { from { opacity: 0; transform: translateY(3px); } }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(17,27,38,.91), rgba(11,19,27,.91)); box-shadow: 0 16px 45px rgba(0,0,0,.12); }
.hero-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(430px, .9fr); gap: 16px; }
.status-hero { min-height: 238px; display: flex; align-items: center; gap: 28px; padding: 30px; position: relative; overflow: hidden; }
.status-hero::after { content: ""; position: absolute; width: 240px; height: 240px; right: -80px; top: -110px; border: 1px solid rgba(35,217,245,.08); border-radius: 50%; box-shadow: 0 0 0 35px rgba(35,217,245,.018), 0 0 0 70px rgba(35,217,245,.012); }
.status-orb { flex: 0 0 auto; width: 104px; height: 104px; display: grid; place-items: center; border: 1px solid rgba(128,148,163,.2); border-radius: 50%; background: rgba(128,148,163,.06); position: relative; }
.status-orb::before { content: ""; position: absolute; inset: 9px; border: 1px dashed rgba(128,148,163,.3); border-radius: 50%; }
.status-orb span { width: 26px; height: 26px; border-radius: 50%; background: #6c7d89; box-shadow: 0 0 30px rgba(108,125,137,.25); }
.status-orb.online { border-color: rgba(76,229,154,.25); background: var(--green-soft); }
.status-orb.online::before { border-color: rgba(76,229,154,.35); animation: spin 14s linear infinite; }
.status-orb.online span { background: var(--green); box-shadow: 0 0 35px rgba(76,229,154,.5); }
.status-orb.offline span { background: var(--red); box-shadow: 0 0 28px rgba(255,97,119,.35); }
@keyframes spin { to { transform: rotate(360deg); } }
.status-main { min-width: 0; position: relative; z-index: 1; }
.status-heading { display: flex; align-items: center; gap: 11px; }
.status-main h3 { margin: 14px 0 6px; font-size: 27px; letter-spacing: -.04em; overflow-wrap: anywhere; }
.status-main > p { margin: 0; color: #91a4b1; line-height: 1.5; }
.badge { display: inline-flex; align-items: center; min-height: 24px; border-radius: 99px; padding: 0 9px; font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.badge.online { color: var(--green); background: var(--green-soft); border: 1px solid rgba(76,229,154,.22); }
.badge.offline { color: var(--red); background: rgba(255,97,119,.1); border: 1px solid rgba(255,97,119,.2); }
.badge.muted { color: #90a3b0; background: rgba(128,148,163,.1); border: 1px solid rgba(128,148,163,.16); }
.inline-facts { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 22px; }
.inline-facts span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.inline-facts strong { margin-left: 5px; color: #d9e6ed; font-size: 11px; letter-spacing: normal; text-transform: none; }

.controls-panel { padding: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.panel-head h3 { margin: 0; font-size: 17px; }
.control-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
.control { min-height: 106px; display: grid; place-items: center; align-content: center; gap: 4px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.018); color: var(--text); transition: .15s; }
.control span { font-size: 19px; color: var(--cyan); }.control strong { font-size: 11px; }.control small { color: var(--muted); font-size: 8px; }
.control.pause span { color: var(--amber); }.control.resume span, .control.run span { color: var(--green); }.control.stop span { color: var(--red); }
.control:hover:not(:disabled) { border-color: var(--line-strong); background: rgba(35,217,245,.04); }
.safety-line { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.45; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.metric { min-height: 125px; display: flex; align-items: center; gap: 15px; padding: 20px; }
.metric-icon { flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; font-size: 17px; }
.metric-icon.cyan { color: var(--cyan); background: var(--cyan-soft); }.metric-icon.purple { color: var(--purple); background: rgba(167,139,250,.1); }.metric-icon.green { color: var(--green); background: var(--green-soft); }.metric-icon.amber { color: var(--amber); background: rgba(247,189,85,.1); }
.metric div { min-width: 0; }.metric small { display: block; color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .1em; }.metric strong { display: block; margin-top: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }.metric p { margin: 5px 0 0; color: #718796; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10px; }
.lower-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 16px; margin-top: 16px; }
.snapshot-card, .activity-card { min-height: 210px; padding: 22px; }
.snapshot-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.snapshot-card > p { margin: 17px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.text-button { border: 0; background: transparent; color: var(--cyan); font-size: 10px; }

.section-title { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 4px 0 22px; }
.section-title h3 { margin: 0; font-size: 25px; letter-spacing: -.035em; }.section-title p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); font-size: 12px; }.section-title .snapshot-actions { margin: 0; }.section-title select { width: 200px; }
.image-panel { position: relative; min-height: calc(100vh - 230px); display: grid; place-items: center; padding: 18px; overflow: hidden; }
.image-placeholder { text-align: center; color: var(--muted); }.image-placeholder div { color: #304958; font-size: 58px; }.image-placeholder strong { display: block; margin-top: 10px; color: #a8bac5; }.image-placeholder p { font-size: 12px; }
.image-panel img { display: block; max-width: 100%; max-height: calc(100vh - 280px); border-radius: 10px; box-shadow: 0 20px 50px rgba(0,0,0,.4); }
.image-meta { position: absolute; left: 28px; right: 28px; bottom: 24px; display: flex; justify-content: space-between; padding: 9px 12px; border-radius: 9px; background: rgba(3,8,12,.8); backdrop-filter: blur(12px); color: #bfd0da; font-size: 11px; }
.journal-panel { padding: 8px 22px; min-height: 420px; }
.event-list { display: grid; }.event-row { display: grid; grid-template-columns: 10px minmax(0,1fr) auto; gap: 13px; align-items: start; padding: 16px 2px; border-bottom: 1px solid var(--line); }.event-row:last-child { border-bottom: 0; }.event-dot { width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px rgba(35,217,245,.25); }.event-row.warning .event-dot { background: var(--amber); }.event-row.error .event-dot, .event-row.failed .event-dot { background: var(--red); }.event-row.success .event-dot, .event-row.acked .event-dot { background: var(--green); }.event-content { min-width: 0; }.event-content strong { display: block; color: #d8e5ec; font-size: 12px; }.event-content p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }.event-row time { color: #617684; font-size: 9px; white-space: nowrap; }.event-list.compact .event-row { padding: 11px 0; }.event-list.compact .event-row:nth-child(n+4) { display: none; }.empty { padding: 30px 0; color: var(--muted); text-align: center; font-size: 12px; }

.security-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }.security-card { position: relative; min-height: 180px; padding: 25px; overflow: hidden; }.security-card > span { position: absolute; right: 18px; top: 10px; color: rgba(35,217,245,.1); font-size: 54px; font-weight: 900; }.security-card h4 { margin: 30px 0 8px; font-size: 15px; }.security-card p { margin: 0; max-width: 90%; color: var(--muted); font-size: 11px; line-height: 1.55; }.session-card { display: grid; grid-template-columns: repeat(3, 1fr) auto; align-items: center; gap: 20px; margin-top: 16px; padding: 22px; }.session-card small, .session-card strong { display: block; }.session-card small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .09em; }.session-card strong { margin-top: 6px; font-size: 12px; }

dialog { width: min(430px, calc(100% - 32px)); border: 1px solid var(--line-strong); border-radius: 20px; padding: 0; background: #0e1821; color: var(--text); box-shadow: var(--shadow); } dialog::backdrop { background: rgba(1,5,8,.78); backdrop-filter: blur(6px); }.dialog-card { padding: 30px; text-align: center; }.dialog-icon { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 17px; border-radius: 15px; background: rgba(255,97,119,.11); color: var(--red); font-size: 20px; }.dialog-card h3 { margin: 5px 0 9px; }.dialog-card > p:not(.eyebrow) { color: var(--muted); line-height: 1.55; font-size: 12px; }.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 24px; }
.toast-region { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 9px; width: min(360px, calc(100% - 40px)); z-index: 100; }.toast { padding: 13px 15px; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(13,24,33,.97); color: #dceaf0; box-shadow: var(--shadow); font-size: 12px; animation: toast-in .2s ease-out; }.toast.error { border-color: rgba(255,97,119,.35); color: #ffb0bb; }.toast.success { border-color: rgba(76,229,154,.3); color: #b8f8d5; } @keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 1100px) {
  .app { grid-template-columns: 78px 1fr; }.sidebar { padding-inline: 10px; }.brand { justify-content: center; padding-inline: 0; }.brand > div:last-child, .nav-item:not(.active)::after, .nav-item { font-size: 0; }.nav-item { justify-content: center; padding: 0; }.nav-item span { font-size: 18px; }.sidebar-foot .server-mini span, .sidebar-foot .button { display: none; }.server-mini { justify-content: center; }.hero-row { grid-template-columns: 1fr; }.metric-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .app { display: block; }.sidebar { position: fixed; left: -250px; width: 238px; padding: 24px 18px; transition: left .2s; box-shadow: 18px 0 50px rgba(0,0,0,.35); }.sidebar.open { left: 0; }.brand { justify-content: flex-start; padding-inline: 10px; }.brand > div:last-child { display: block; }.nav-item { justify-content: flex-start; padding: 0 14px; font-size: 14px; }.nav-item span { font-size: 17px; }.sidebar-foot .server-mini span, .sidebar-foot .button { display: block; }.menu-toggle { display: block; }.topbar { padding: 14px 16px; }.topbar > div:nth-child(2), .user-chip div, .instance-select span { display: none; }.instance-select select { width: min(42vw, 180px); }.workspace { padding: 20px 16px 38px; }.status-hero { min-height: 0; padding: 24px; align-items: flex-start; }.status-orb { width: 72px; height: 72px; }.status-orb span { width: 19px; height: 19px; }.status-main h3 { font-size: 21px; }.control-grid { grid-template-columns: repeat(2, 1fr); }.control { min-height: 92px; }.metric-grid, .lower-grid, .security-grid { grid-template-columns: 1fr; }.section-title { align-items: flex-start; flex-direction: column; }.section-title select { width: 100%; }.session-card { grid-template-columns: 1fr 1fr; }.session-card .button { grid-column: 1 / -1; }.image-panel { min-height: 58vh; }
}
@media (max-width: 480px) {
  .auth-shell { padding: 16px; }.auth-card { padding: 34px 22px; }.status-hero { display: block; }.status-orb { margin-bottom: 20px; }.metric-grid { grid-template-columns: 1fr; }.session-card { grid-template-columns: 1fr; }.dialog-actions { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
