:root {
  color-scheme: light;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #182538;
  background: #f4f6f9;
  --ink: #182538;
  --muted: #536174;
  --border: #dce3eb;
  --paper: #fff;
  --wash: #f4f6f9;
  --night: #102033;
  --night-raised: #20374b;
  --night-text: #bacada;
  --accent: #087e73;
  --accent-strong: #05665e;
  --radius: 13px;
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #269f92; outline-offset: 3px; }
.skip-link { position: fixed; z-index: 20; top: .5rem; left: .5rem; padding: .6rem; background: #fff; transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.loading { padding: 3rem; }
.icon { flex: 0 0 auto; vertical-align: middle; }

.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { display: flex; flex-direction: column; gap: 2rem; position: sticky; top: 0; height: 100dvh; overflow-y: auto; background: var(--night); color: #fff; padding: 1.65rem .95rem 1rem; }
.brand { display: flex; align-items: center; gap: .75rem; margin-inline: .45rem; color: #fff; font-size: 1.14rem; font-weight: 720; line-height: 1.18; text-decoration: none; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; background: #d8f6ee; color: #11695e; border-radius: 10px; }
.brand-mark .icon { width: 25px; height: 25px; }
.brand small { display: block; font-size: .79rem; color: var(--night-text); font-weight: 480; margin-top: .18rem; letter-spacing: 0; }
.nav-section + .nav-section { margin-top: 1.55rem; }
.nav-section p { margin: 0 .65rem .42rem; color: var(--night-text); font-size: .75rem; font-weight: 650; }
.nav-link { display: flex; align-items: center; gap: .65rem; min-height: 41px; padding: .5rem .65rem; color: #d0dbe7; font-size: .875rem; border-radius: 8px; text-decoration: none; }
.nav-link:hover { background: #172c41; color: white; }
.nav-link.selected { background: var(--night-raised); color: #fff; font-weight: 650; }
.nav-link.selected .icon { color: #89ded0; }
.tally { margin-left: auto; padding: .02rem .42rem; border-radius: 7px; background: #3c4c55; color: #e8f1ed; font-size: .75rem; }
.topbar { height: 64px; padding-inline: clamp(1.25rem, 3.3vw, 3rem); background: var(--paper); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.top-path, .top-meta { display: flex; align-items: center; gap: .6rem; font-size: .875rem; }
.top-path .icon, .top-meta { color: var(--muted); }
.top-path > .icon { width: 14px; }
.top-meta { white-space: nowrap; }
.top-meta .icon { width: 16px; }
.top-clock { display: inline-flex; align-items: center; gap: .38rem; }
.content { max-width: 1500px; margin-inline: auto; padding: 2.2rem clamp(1.25rem, 3.3vw, 3rem) 3rem; }
.content:focus { outline: none; }
.mobile-menu, .menu-scrim { display: none !important; }

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 2.15rem; line-height: 1.15; letter-spacing: -.034em; margin-bottom: .42rem; }
h2 { font-size: 1.13rem; line-height: 1.25; letter-spacing: -.015em; margin-bottom: .26rem; }
h3 { font-size: .99rem; margin-bottom: .32rem; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.15rem; margin-bottom: 1.55rem; }
.page-heading p { color: var(--muted); margin: 0; }
.button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 39px; padding: .48rem .85rem; border: 1px solid transparent; border-radius: 8px; font-weight: 640; font-size: .875rem; text-decoration: none; white-space: nowrap; }
.button .icon { width: 16px; height: 16px; }
.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.primary:hover { background: #054e48; border-color: #054e48; }
.secondary, .icon-button { background: #fff; border-color: var(--border); color: var(--ink); }
.secondary:hover, .icon-button:hover { background: #edf2f6; }
.icon-button { padding: .43rem; min-width: 39px; }
.text-link { color: var(--accent-strong); font-weight: 650; font-size: .875rem; text-underline-offset: 3px; }
.dashboard-window { display: flex; justify-content: space-between; color: var(--muted); font-size: .825rem; padding: 0 .1rem .52rem; gap: .5rem; }
.dashboard-window span:first-child { color: #36465a; font-weight: 650; }

.metric-board { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.metric { min-width: 0; padding: .94rem 1.15rem 1.1rem; }
.metric + .metric { border-left: 1px solid var(--border); }
.metric-label { display: flex; align-items: center; gap: .4rem; color: #42556a; font-size: .875rem; font-weight: 620; }
.metric-label .icon { color: var(--accent); width: 16px; height: 16px; }
.metric strong { display: block; color: #132638; font-size: 1.87rem; line-height: 1.15; letter-spacing: -.04em; margin-top: .36rem; font-variant-numeric: tabular-nums; }
.metric small { display: block; color: var(--muted); margin-top: .26rem; font-size: .8rem; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); gap: 1rem; margin-top: 1rem; }
.panel { min-width: 0; background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius); }
.panel-head { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 1.1rem 1.18rem .92rem; }
.panel-head p { margin: 0; color: var(--muted); font-size: .875rem; }
.distribution { display: grid; gap: .57rem; padding: 0 1.18rem 1.2rem; }
.bar-row { display: grid; grid-template-columns: 10rem minmax(0,1fr) 1.3rem; align-items: center; gap: .7rem; font-size: .875rem; }
.bar-row strong { text-align: right; font-variant-numeric: tabular-nums; }
.bar { --bar-fill: #647b93; appearance: none; height: .55rem; width: 100%; border: none; border-radius: 6px; overflow: hidden; background: #edf1f5; }
.bar::-webkit-progress-bar { background: #edf1f5; }
.bar::-webkit-progress-value { background: var(--bar-fill); border-radius: 6px; }
.bar::-moz-progress-bar { background: var(--bar-fill); border-radius: 6px; }
.bar.teal { --bar-fill: #198577; }
.bar.blue { --bar-fill: #3d73a9; }
.bar.violet { --bar-fill: #7866a2; }
.bar.red { --bar-fill: #a66662; }
.health-list { padding-inline: 1.18rem; }
.health-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: .61rem; align-items: center; padding: .55rem 0; font-size: .875rem; border-bottom: 1px solid #edf1f4; }
.health-row small { display: block; color: var(--muted); font-size: .77rem; }
.health-icon { color: #446175; display: grid; place-items: center; width: 33px; height: 33px; border-radius: 8px; background: #edf2f6; }
.health-icon .icon { width: 16px; }
.panel-link { display: inline-block; margin: .72rem 1.18rem .9rem; }
.recent { margin-top: 1rem; }

.table-scroll { overflow-x: auto; border-radius: inherit; }
table { border-collapse: collapse; width: 100%; min-width: 660px; text-align: left; font-size: .875rem; }
thead th { color: #425267; background: #f1f4f7; font-weight: 650; white-space: nowrap; }
th, td { padding: .62rem 1rem; border-bottom: 1px solid #e8edf2; vertical-align: middle; }
th:first-child, td:first-child { padding-left: 1.18rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fafb; }
td small { display: block; color: var(--muted); font-size: .78rem; margin-top: .1rem; }
.row-link { border: 0; background: none; padding: 0; text-align: start; color: #163650; font-weight: 650; }
.row-link:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }
.numeric { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.tag { display: inline-block; border-radius: 6px; background: #edf1f5; color: #425368; font-size: .77rem; font-weight: 650; line-height: 1.25; padding: .27rem .48rem; white-space: nowrap; }
.tag.green { background: #e2f3e9; color: #1e6246; }
.tag.teal { background: #e0f3ef; color: #17665c; }
.tag.blue { background: #e4eef9; color: #275784; }
.tag.amber { background: #fff0d6; color: #714a06; }
.tag.violet { background: #eee8f6; color: #634984; }
.tag.red { background: #fae9e8; color: #8b3837; }
.tags { display: flex; flex-wrap: wrap; gap: .26rem; }
.empty { padding: 2.05rem 1.25rem; }
.empty p { margin: .24rem 0 0; color: var(--muted); }

.filters { display: grid; grid-template-columns: minmax(12rem, 1.5fr) repeat(3,minmax(8rem,1fr)); align-items: end; gap: .75rem .85rem; padding: 1rem 1.18rem .83rem; }
.filter-actions, .form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.results-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .65rem 1rem; padding: .75rem 1.18rem; }
.result-count { color: var(--muted); font-size: .825rem; }
.import-actions { margin-block-start: 1rem; }
.field { display: grid; align-content: start; gap: .33rem; min-width: 0; color: var(--ink); font-size: .875rem; font-weight: 640; }
.field small { color: var(--muted); font-weight: 400; font-size: .8rem; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; padding: .52rem .66rem; border: 1px solid #bfcbd8; background: #fff; border-radius: 7px; color: var(--ink); font-weight: 440; min-height: 39px; }
.field input::placeholder { color: #59697b; }
.field textarea { resize: vertical; }
.field select { appearance: none; padding-right: 2rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23425368' stroke-width='1.5'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-position: right .57rem center; background-repeat: no-repeat; background-size: 15px; }
.search-input { position: relative; }
.search-input .icon { position: absolute; left: .63rem; top: .65rem; color: var(--muted); width: 16px; height: 16px; pointer-events: none; }
.search-input input { padding-left: 2rem; }
.settings-form { max-width: 900px; display: grid; gap: 1rem; }
.settings-form > .form-panel { display: grid; grid-template-columns: minmax(0,1fr); gap: .9rem; margin-block-end: 0; }
.settings-form > .form-panel > :is(h2, .form-grid, .subtle, .form-error) { margin-block: 0; }
.form-panel { padding: 1.25rem; margin-bottom: 1rem; }
.form-panel h2 { margin-bottom: .85rem; }
.invite-landing { width: min(35rem, calc(100% - 2rem)); margin: 12vh auto 2rem; padding: 1.5rem; }
.invite-panel-form { display: flex; align-items: end; flex-wrap: wrap; gap: .65rem; margin-top: .85rem; }
.invite-panel-form .field { min-width: min(14rem, 100%); flex: 1 1 16rem; }
.invite-panel-form .form-error { flex: 1 1 100%; }
.invite-table { margin-top: 1rem; }
.invite-table table { min-width: 25rem; }
.form-panel .form-grid + .form-grid, .form-panel .check + .form-grid { margin-top: .9rem; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem; }
.check { display: inline-flex; align-items: center; gap: .43rem; font-size: .875rem; font-weight: 560; min-height: 27px; }
.check input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent-strong); }
.choices { display: flex; flex-wrap: wrap; gap: .4rem .9rem; }
.setting-row { margin-top: .9rem; }
.setting-row p, .subtle { color: var(--muted); margin: .32rem 0 0; font-size: .875rem; }
.subtle + .form-actions { margin-top: .75rem; }
.form-error { color: #9a302a; margin: .55rem 0; font-size: .875rem; }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: .45rem .75rem .75rem; margin: 0; min-width: 0; }
legend { padding: 0 .3rem; font-size: .875rem; font-weight: 650; }
details { margin-top: .8rem; }
summary { cursor: pointer; color: var(--accent-strong); font-size: .875rem; font-weight: 650; }
.version-list > div { border-bottom: 1px solid var(--border); padding: .7rem 0; font-size: .875rem; }
.version-list p { margin: .3rem 0; }

.dialog { border: 1px solid var(--border); border-radius: 15px; padding: 0; width: min(620px, calc(100% - 1.5rem)); max-height: min(84dvh, 780px); color: var(--ink); box-shadow: 0 22px 70px #0b182547; }
.dialog::backdrop { background: #10203399; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; border-bottom: 1px solid var(--border); padding: 1rem 1.15rem; }
.dialog-head h2 { margin: .2rem 0; }
.dialog-head p { margin: .27rem 0 0; color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.dialog-body { padding: 1rem 1.15rem 1.2rem; display: grid; gap: .75rem; }
.dialog-body p, .dialog-body h3 { margin: 0; }
.detail-tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.detail-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; margin: 0; }
.detail-list dt { color: var(--muted); font-size: .8rem; }
.detail-list dd { margin: .12rem 0 0; overflow-wrap: anywhere; }
.original { background: #f0f4f7; border-radius: 8px; padding: .72rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.dialog-body form { display: grid; gap: .65rem; border-top: 1px solid var(--border); padding-top: .8rem; }
.label-form > button { justify-self: start; }
.toast { position: fixed; right: 1rem; bottom: 1rem; z-index: 10; border-radius: 9px; background: var(--night); color: #fff; padding: .62rem .95rem; box-shadow: 0 6px 24px #10203332; max-width: calc(100% - 2rem); }

@media (max-width: 1080px) {
  .shell { grid-template-columns: 213px minmax(0, 1fr); }
  .bar-row { grid-template-columns: 8rem minmax(0,1fr) 1.1rem; gap: .5rem; }
  .filters { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .metric { padding-inline: .8rem; }
}
@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 10rem minmax(0,1fr) 1.3rem; }
}
@media (max-width: 740px) {
  .shell { display: block; }
  .sidebar { display: none; position: fixed; z-index: 6; inset: 0 auto 0 0; width: min(265px, 78vw); }
  .sidebar.open { display: flex; }
  .mobile-menu { display: inline-flex !important; }
  .menu-scrim { display: block !important; position: fixed; inset: 0; z-index: 5; background: #102033a0; border: 0; }
  .topbar { height: 57px; }
  .content { padding-top: 1.2rem; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 1.15rem; }
  h1 { font-size: 1.8rem; }
  .metric-board { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric:nth-child(3) { border-left: 0; }
  .metric:nth-child(n+3) { border-top: 1px solid var(--border); }
  .filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 420px) {
  .path-root, .top-path > .icon { display: none; }
  .top-clock { display: none; }
  .bar-row { grid-template-columns: 8rem minmax(0,1fr) 1rem; }
  .panel-head { flex-wrap: wrap; gap: .63rem; }
  .form-grid { grid-template-columns: 1fr; }
}
.auth-shell { min-height:100dvh; display:grid; place-items:center; padding:1.25rem; background:linear-gradient(150deg,#e7f1ef,#f4f6f9 55%); }
.auth-card { width:min(100%,27rem); background:white; border:1px solid var(--border); border-block-start:4px solid var(--accent); border-radius:var(--radius); padding:clamp(1.4rem,5vw,2.5rem); box-shadow:0 16px 48px #1020330d; }
.auth-card header,.top-meta { display:flex; align-items:center; gap:.65rem; }
.auth-card header { justify-content:space-between; margin-block-end:2.75rem; }
.auth-card header strong { color:var(--accent-strong); }
.auth-card h1 { font-size:2rem; margin:0; line-height:1.2; }
.auth-card > p { color:var(--muted); margin:.6rem 0 1.7rem; }
.auth-card form { display:grid; gap:1rem; }
.auth-card form button { min-height:44px; margin-block-start:.35rem; }
.top-meta .button { min-height:34px; padding:.3rem .6rem; }
.nav-link[aria-current="page"] { box-shadow:inset 3px 0 #89ded0; }
[dir="rtl"] .nav-link[aria-current="page"] { box-shadow:inset -3px 0 #89ded0; }
[dir="rtl"] table,[dir="rtl"] .row-link { text-align:start; }
[dir="rtl"] .tally { margin-left:0; margin-inline-start:auto; }
[dir="rtl"] .field select { background-position:left .57rem center; padding-inline: .66rem 2rem; }
[dir="rtl"] .search-input .icon { left:auto; right:.63rem; }
[dir="rtl"] .search-input input { padding-inline:2rem .66rem; }
[dir="rtl"] h1,[dir="rtl"] h2,[dir="rtl"] .metric strong { letter-spacing:normal; }
input[type="email"],input[type="url"] { direction:ltr; }
@media(max-width:740px) {
  [dir="rtl"] .sidebar { inset:0 0 0 auto; }
  .top-clock { display:none; }
  .topbar { gap:.4rem; }
}

.check .runtime-switch { appearance: none; width: 2.4rem; height: 1.4rem; padding: 0.12rem; border: 1px solid currentColor; border-radius: 1rem; cursor: pointer; display: inline-flex; align-items: center; }
.runtime-switch::before { content: ''; width: 1rem; height: 1rem; background: currentColor; border-radius: 50%; }
.runtime-switch:checked { justify-content: flex-end; }
.runtime-switch:disabled { opacity: .55; cursor: default; }

.form-panel > .subtle + .table-scroll { margin-block-start: 1rem; }
.dialog-body > .form-actions, .dialog-body form > .form-actions { padding-block-start: .35rem; }
@media (max-width: 420px) {
  .filter-actions { grid-column: 1 / -1; }
  .import-actions .button, .invite-panel-form .button { max-width: 100%; white-space: normal; }
}
