:root {
  color-scheme: dark;
  --bg: #080b12;
  --sidebar: #0b0f18;
  --surface: #101621;
  --surface-2: #151c28;
  --surface-3: #1a2231;
  --line: #252e3e;
  --line-soft: #1b2330;
  --text: #f2f5f9;
  --muted: #8f9bad;
  --subtle: #626d7e;
  --cyan: #64d9ed;
  --cyan-strong: #16bdd9;
  --violet: #8f7bf4;
  --green: #46d799;
  --amber: #f2b85b;
  --red: #f87171;
  --shadow: 0 18px 55px rgba(0, 0, 0, .32);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { font-size: 16px; line-height: 1.5; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px 1fr; }
.sidebar { background: var(--sidebar); border-right: 1px solid var(--line-soft); padding: 25px 16px 18px; position: fixed; inset: 0 auto 0 0; width: 252px; display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; color: var(--text); text-decoration: none; }
.brand-mark { width: 36px; height: 36px; padding: 8px; border: 1px solid #364156; border-radius: 10px; display: grid; gap: 3px; background: linear-gradient(145deg, #171f2e, #0c111b); }
.brand-mark span { height: 4px; border-radius: 5px; background: var(--cyan); }
.brand-mark span:nth-child(2) { width: 67%; background: var(--violet); }
.brand strong { display: block; font-size: 1rem; letter-spacing: .12em; }
.brand small { display: block; color: var(--muted); letter-spacing: .22em; font-size: .62rem; margin-top: -2px; }
.nav { display: grid; gap: 4px; }
.nav-label { margin: 22px 12px 7px; font-size: .68rem; font-weight: 700; color: #566175; letter-spacing: .13em; text-transform: uppercase; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 13px; color: #9ca7b7; text-decoration: none; border-radius: 9px; font-size: .9rem; font-weight: 600; border: 1px solid transparent; }
.nav-link:hover { color: var(--text); background: #111723; }
.nav-link.active { color: var(--text); background: #161e2b; border-color: #222d3e; box-shadow: inset 3px 0 var(--cyan); }
.nav-icon { width: 16px; text-align: center; color: #758197; font-size: 1.1rem; }
.project-dot, .status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 3px rgba(100,217,237,.08); }
.project-dot.cyan, .status-dot { background: var(--cyan); }
.project-dot.violet { background: var(--violet); box-shadow: 0 0 0 3px rgba(143,123,244,.08); }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line-soft); padding: 17px 8px 0; }
.system-state { display: flex; align-items: flex-start; gap: 10px; font-size: .76rem; }
.system-state .status-dot { margin-top: 5px; background: var(--green); box-shadow: 0 0 0 3px rgba(70,215,153,.1); }
.system-state strong, .system-state small { display: block; }
.system-state small { color: var(--subtle); margin-top: 2px; }
.back-link { display: block; color: var(--muted); font-size: .76rem; text-decoration: none; margin-top: 18px; }
.main { grid-column: 2; min-width: 0; }
.topbar { height: 88px; padding: 0 36px; display: flex; align-items: center; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; background: rgba(8,11,18,.88); backdrop-filter: blur(15px); z-index: 10; }
.eyebrow { margin: 0 0 2px; color: var(--cyan); font-size: .64rem; font-weight: 800; letter-spacing: .18em; }
.topbar h1 { margin: 0; font-size: 1.28rem; line-height: 1.25; letter-spacing: -.02em; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 17px; }
.icon-button, .menu-button { width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.icon-button:hover, .menu-button:hover { color: var(--text); border-color: #3a465a; }
.menu-button { display: none; margin-right: 15px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 9px; background: linear-gradient(135deg, #233046, #313c53); display: grid; place-items: center; color: var(--cyan); font-weight: 800; font-size: .85rem; }
.user-copy strong, .user-copy small { display: block; font-size: .8rem; }
.user-copy small { color: var(--muted); font-size: .7rem; text-transform: capitalize; }
.content { padding: 30px 36px 70px; max-width: 1500px; margin: 0 auto; }
.loading-state, .empty-state { min-height: 360px; display: grid; place-items: center; align-content: center; color: var(--muted); text-align: center; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--cyan); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: 1rem; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: .82rem; }
.overview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 30px; }
.metric { position: relative; overflow: hidden; min-height: 116px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(145deg, var(--surface-2), var(--surface)); }
.metric::after { content: ""; position: absolute; width: 75px; height: 75px; border-radius: 50%; top: -34px; right: -25px; background: var(--glow, rgba(100,217,237,.08)); filter: blur(6px); }
.metric-label { color: var(--muted); font-size: .76rem; font-weight: 600; }
.metric-value { display: block; font-size: 2rem; font-weight: 720; line-height: 1.25; letter-spacing: -.05em; margin-top: 9px; }
.metric-detail { color: var(--subtle); font-size: .7rem; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(295px, .75fr); gap: 18px; align-items: start; }
.panel { border: 1px solid var(--line); background: var(--surface); border-radius: 13px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.1); }
.panel-head { min-height: 64px; padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); }
.panel-head h2 { margin: 0; font-size: .92rem; }
.panel-head span { color: var(--muted); font-size: .72rem; }
.update-list { display: grid; }
.update-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 13px; align-items: center; padding: 17px 18px; border-bottom: 1px solid var(--line-soft); cursor: pointer; transition: background .15s ease; }
.update-card:last-child { border-bottom: 0; }
.update-card:hover, .update-card.selected { background: #141b27; }
.project-badge { width: 42px; height: 42px; border: 1px solid #293549; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: var(--cyan); background: #101825; }
.project-badge.portal { color: #ad9efa; }
.update-title { margin: 0 0 3px; font-size: .88rem; font-weight: 680; }
.update-meta { color: var(--muted); font-size: .72rem; display: flex; gap: 8px; flex-wrap: wrap; }
.update-meta code, code { font-family: "SFMono-Regular", Consolas, monospace; color: #a9b5c6; }
.status { display: inline-flex; align-items: center; gap: 6px; border-radius: 20px; padding: 5px 9px; font-size: .66rem; font-weight: 720; white-space: nowrap; border: 1px solid; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-new, .status-ready { color: var(--cyan); border-color: rgba(100,217,237,.23); background: rgba(100,217,237,.06); }
.status-preview_ready, .status-succeeded, .status-deployed { color: var(--green); border-color: rgba(70,215,153,.23); background: rgba(70,215,153,.06); }
.status-building, .status-deploying, .status-running, .status-queued { color: var(--amber); border-color: rgba(242,184,91,.25); background: rgba(242,184,91,.06); }
.status-failed, .status-deploy_failed { color: var(--red); border-color: rgba(248,113,113,.25); background: rgba(248,113,113,.06); }
.status-rejected, .status-stopped { color: var(--muted); border-color: var(--line); background: rgba(255,255,255,.02); }
.activity-list { padding: 4px 18px; }
.activity { display: grid; grid-template-columns: 10px minmax(0,1fr); gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line-soft); }
.activity:last-child { border-bottom: 0; }
.activity-pin { width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-top: 7px; box-shadow: 0 0 0 3px rgba(70,215,153,.08); }
.activity.failed .activity-pin { background: var(--red); }
.activity strong { display: block; font-size: .76rem; }
.activity p { margin: 3px 0; color: var(--muted); font-size: .71rem; }
.activity time { color: var(--subtle); font-size: .65rem; }
.detail-panel { margin-top: 18px; }
.detail-body { padding: 20px; }
.detail-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; }
.detail-top h2 { margin: 0 0 7px; font-size: 1.12rem; }
.detail-top p { margin: 0; color: var(--muted); font-size: .81rem; max-width: 680px; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 9px; margin: 20px 0; }
.fact { border: 1px solid var(--line-soft); background: #0d121b; padding: 12px; border-radius: 9px; }
.fact small { display: block; color: var(--subtle); font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; }
.fact strong { display: block; margin-top: 5px; font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.change-stats { color: var(--muted); font-size: .74rem; }
.addition { color: var(--green); } .deletion { color: var(--red); }
.action-row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.button { min-height: 39px; border-radius: 8px; padding: 0 14px; font-size: .76rem; font-weight: 700; cursor: pointer; border: 1px solid transparent; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button.primary { color: #061217; background: var(--cyan); border-color: var(--cyan); }
.button.primary:hover:not(:disabled) { background: #8ce8f5; }
.button.secondary { color: var(--text); background: var(--surface-3); border-color: #303a4b; }
.button.danger { color: var(--red); background: rgba(248,113,113,.05); border-color: rgba(248,113,113,.25); margin-left: auto; }
.preview-shell { margin-top: 18px; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: #06080d; }
.preview-toolbar { min-height: 44px; display: flex; align-items: center; padding: 0 12px; gap: 10px; background: #111722; border-bottom: 1px solid var(--line); }
.traffic-lights { display: flex; gap: 5px; }.traffic-lights i { width: 8px; height: 8px; border-radius: 50%; background: #344052; }.traffic-lights i:first-child { background: #ec6b69; }.traffic-lights i:nth-child(2) { background: #e8b65f; }.traffic-lights i:last-child { background: #57c88b; }
.preview-address { flex: 1; max-width: 560px; margin: 0 auto; border: 1px solid #283243; background: #090d14; color: var(--muted); border-radius: 6px; padding: 5px 11px; font-size: .68rem; text-align: center; }
.preview-frame { width: 100%; height: 590px; border: 0; background: white; display: block; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 700px; }
th, td { padding: 14px 18px; border-bottom: 1px solid var(--line-soft); text-align: left; font-size: .75rem; }
th { color: var(--subtle); text-transform: uppercase; letter-spacing: .07em; font-size: .63rem; }
td { color: #bcc5d2; } td strong { color: var(--text); }
.log-box { max-height: 330px; overflow: auto; padding: 16px; background: #070a10; color: #9fb0c4; font: .72rem/1.7 "SFMono-Regular", Consolas, monospace; }
.log-line { display: grid; grid-template-columns: 75px 1fr; gap: 12px; }.log-line time { color: #536177; }
.refresh-status { max-width: 320px; color: var(--muted); font-size: .7rem; text-align: right; }
.refresh-status:empty { display: none; }
.refresh-status.checking { color: var(--amber); }
.refresh-status.success { color: var(--green); }
.refresh-status.error { color: var(--red); }
.icon-button.is-refreshing { animation: refresh-spin .8s linear infinite; }
@keyframes refresh-spin { to { transform: rotate(360deg); } }
.toast-region { position: fixed; right: 22px; top: 92px; display: grid; gap: 9px; z-index: 50; }
.toast { min-width: 290px; max-width: 420px; padding: 13px 15px; border: 1px solid #334055; border-radius: 10px; background: #151d2a; box-shadow: var(--shadow); font-size: .78rem; animation: toast-in .2s ease-out; }
.toast.error { border-color: rgba(248,113,113,.4); }.toast strong { display: block; margin-bottom: 2px; }.toast span { color: var(--muted); }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }
.dialog { width: min(440px, calc(100vw - 30px)); border: 1px solid #303b4d; border-radius: 15px; background: #111722; color: var(--text); padding: 0; box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(2,5,10,.78); backdrop-filter: blur(5px); }
.dialog form { padding: 24px; }.dialog h2 { margin: 14px 0 7px; font-size: 1.05rem; }.dialog p { color: var(--muted); font-size: .8rem; margin: 0; }
.dialog-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: rgba(100,217,237,.08); color: var(--cyan); font-weight: 800; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
@media (max-width: 1050px) { .overview-grid { grid-template-columns: repeat(2, 1fr); }.workspace { grid-template-columns: 1fr; }.facts { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 760px) {
  .app-shell { display: block; }.main { grid-column: auto; }.sidebar { transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow); }.sidebar.open { transform: translateX(0); }
  .menu-button { display: block; }.topbar { padding: 0 17px; height: 76px; }.content { padding: 22px 16px 55px; }.user-copy { display: none; }.top-actions { gap: 8px; }
  .refresh-status { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .refresh-status:empty { display: none; }
  .overview-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }.metric { padding: 16px; min-height: 105px; }.metric-value { font-size: 1.7rem; }
  .update-card { grid-template-columns: 38px minmax(0,1fr); padding: 15px; }.update-card > .status { grid-column: 2; justify-self: start; }.project-badge { width: 38px; height: 38px; }
  .facts { grid-template-columns: 1fr 1fr; }.button.danger { margin-left: 0; }.preview-frame { height: 480px; }
}
@media (max-width: 430px) { .overview-grid { grid-template-columns: 1fr 1fr; }.metric-label { font-size: .69rem; }.facts { grid-template-columns: 1fr; }.content { padding-inline: 12px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
