/* Orbit Monitor — reset, helpers, app shell (sidebar, top bar, page frame). */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 var(--fs-base)/var(--lh-base) var(--font-sans); -webkit-font-smoothing: antialiased; font-feature-settings: "ss01", "tnum"; min-height: 100vh; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3, h4 { font-weight: 600; line-height: var(--lh-tight); letter-spacing: -0.012em; text-wrap: balance; }
a { color: var(--accent-text); text-decoration: none; } a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; } button { cursor: pointer; background: none; border: 0; padding: 0; }
img, svg { display: block; max-width: 100%; } table { border-collapse: collapse; width: 100%; }
code, kbd, pre, samp, .mono { font-family: var(--font-mono); font-size: 0.92em; font-feature-settings: normal; }
[hidden] { display: none !important; }
:focus { outline: none; } :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
::placeholder { color: var(--text-3); opacity: 1; }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
.icon { width: 16px; height: 16px; flex: none; } .icon--sm { width: 14px; height: 14px; } .icon--lg { width: 20px; height: 20px; } .icon--xl { width: 28px; height: 28px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 300; background: var(--accent); color: #fff; padding: 8px 12px; border-radius: var(--radius); } .skip-link:focus { left: 8px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; } }

/* helpers */
.row { display: flex; align-items: center; gap: var(--sp-2); } .row--wrap { flex-wrap: wrap; } .row--between { justify-content: space-between; } .row--top { align-items: flex-start; }
.gap-1 { gap: var(--sp-1); } .gap-3 { gap: var(--sp-3); } .gap-4 { gap: var(--sp-4); }
.stack > * + * { margin-top: var(--sp-2); } .stack-3 > * + * { margin-top: var(--sp-3); } .stack-4 > * + * { margin-top: var(--sp-4); } .stack-6 > * + * { margin-top: var(--sp-6); }
.grow { flex: 1 1 auto; min-width: 0; } .ml-auto { margin-left: auto; } .mt-2 { margin-top: var(--sp-2); } .mt-4 { margin-top: var(--sp-4); } .mt-6 { margin-top: var(--sp-6); }
.muted { color: var(--text-3); } .small { font-size: var(--fs-sm); } .xs { font-size: var(--fs-xs); } .strong { font-weight: 600; } .nowrap { white-space: nowrap; } .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; } .text-right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.grid { display: grid; gap: var(--sp-4); } .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; } .span-all { grid-column: 1 / -1; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
html[data-sidebar="collapsed"] .app { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--nav-bg); border-right: 1px solid var(--nav-border); color: var(--nav-text); overflow: hidden; }
.brand { display: flex; align-items: center; gap: var(--sp-3); height: var(--topbar-h); padding: 0 var(--sp-4); color: var(--text); flex: none; } .brand:hover { text-decoration: none; }
.brand__mark { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 10px; background: var(--accent); color: #fff; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; } .brand__name { font-weight: 650; font-size: var(--fs-md); letter-spacing: -0.015em; } .brand__by { font-size: 11.5px; color: var(--nav-text-muted); }
.nav { flex: 1; overflow-y: auto; padding: var(--sp-2) var(--sp-3) var(--sp-4); }
.nav__section + .nav__section { margin-top: var(--sp-4); }
.nav__heading { padding: 0 var(--sp-3) 6px; font-size: 12px; font-weight: 600; color: var(--nav-text-muted); }
.nav__link { display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 var(--sp-3); border-radius: 10px; color: var(--nav-text); font-size: var(--fs-sm); font-weight: 500; transition: background var(--dur-fast), color var(--dur-fast); }
.nav__link .icon { width: 17px; height: 17px; opacity: 0.85; } .nav__link:hover { background: var(--nav-hover); color: var(--text); text-decoration: none; }
.nav__link[aria-current="page"] { background: var(--nav-active-bg); color: var(--nav-active-text); font-weight: 600; } .nav__link[aria-current="page"] .icon { opacity: 1; }
.nav__label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav__badge { min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); font-size: 11px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.nav__badge--alert { background: var(--danger-soft); color: var(--danger-text); }
.nav__soon { font-size: 11px; font-weight: 600; color: var(--nav-text-muted); border: 1px solid var(--nav-border); border-radius: 999px; padding: 0 7px; line-height: 17px; }
.sidebar__foot { border-top: 1px solid var(--nav-border); padding: var(--sp-3); flex: none; }
html[data-sidebar="collapsed"] .brand__text, html[data-sidebar="collapsed"] .nav__heading, html[data-sidebar="collapsed"] .nav__label, html[data-sidebar="collapsed"] .nav__badge, html[data-sidebar="collapsed"] .nav__soon { display: none; }
html[data-sidebar="collapsed"] .brand, html[data-sidebar="collapsed"] .nav__link { justify-content: center; padding: 0; }
html[data-sidebar="collapsed"] .nav__section + .nav__section { margin-top: var(--sp-2); padding-top: var(--sp-2); border-top: 1px solid var(--nav-border); }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-6); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar__actions { display: flex; align-items: center; gap: var(--sp-1); margin-left: auto; }
.search-trigger { display: flex; align-items: center; gap: 10px; width: min(460px, 100%); height: 38px; padding: 0 10px 0 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text-3); font-size: var(--fs-sm); text-align: left; transition: border-color var(--dur-fast); }
.search-trigger:hover { border-color: var(--border-strong); } .search-trigger__label { flex: 1; } .search-trigger__hint { display: flex; gap: 3px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--text-2); transition: background var(--dur-fast), color var(--dur-fast); } .icon-btn:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.icon-btn__dot { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger-dot); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); box-sizing: content-box; line-height: 1; transform: translate(25%, -15%); }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 700; flex: none; }
.user-btn { display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 8px 0 5px; border-radius: 12px; color: var(--text-2); } .user-btn:hover { background: var(--surface-3); }
.user-btn__text { display: flex; flex-direction: column; line-height: 1.2; text-align: left; } .user-btn__name { font-size: var(--fs-sm); font-weight: 600; color: var(--text); } .user-btn__role { font-size: 12px; color: var(--text-3); }
.menu-anchor { position: relative; }
.content { flex: 1; padding: 28px var(--sp-8) var(--sp-8); min-width: 0; } .content--narrow { max-width: 1080px; }
.breadcrumbs { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-3); margin-bottom: var(--sp-3); flex-wrap: wrap; } .breadcrumbs a { color: var(--text-3); } .breadcrumbs a:hover { color: var(--text); } .breadcrumbs .icon { width: 13px; height: 13px; } .breadcrumbs span:last-child { color: var(--text-2); }
.page-head { display: flex; align-items: flex-end; gap: var(--sp-4); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.page-head__title { font-size: var(--fs-2xl); font-weight: 650; letter-spacing: -0.025em; } .page-head__sub { margin-top: 5px; color: var(--text-3); font-size: var(--fs-sm); max-width: 78ch; }
.page-head__actions { margin-left: auto; display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.app-foot { display: flex; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; padding: var(--sp-4) var(--sp-8); border-top: 1px solid var(--border); color: var(--text-3); font-size: var(--fs-xs); }
@media (max-width: 1280px) { .content { padding: 24px var(--sp-6) var(--sp-6); } }
@media (max-width: 860px) {
  .app, html[data-sidebar="collapsed"] .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; } html[data-nav="open"] .sidebar { display: flex; position: fixed; z-index: 80; width: var(--sidebar-w); box-shadow: var(--shadow-lg); }
  .topbar { padding: 0 var(--sp-3); } .content { padding: var(--sp-4); } .search-trigger__label, .search-trigger__hint { display: none; } .search-trigger { width: 38px; padding: 0; justify-content: center; border-color: transparent; background: transparent; }
  .user-btn__text { display: none; } .page-head__actions { margin-left: 0; width: 100%; } .app-foot { padding: var(--sp-4); }
}
