:root {
  color-scheme: light;
  --navy: #112d48;
  --navy-deep: #0b2035;
  --blue: #17496b;
  --accent: #ff9659;
  --text: #152e41;
  --subtle: #4e6475;
  --faint: #667987;
  --line: #dce4e9;
  --soft: #eef3f6;
  --canvas: #f5f7f9;
  --white: #fff;
  --green: #15634f;
  --amber: #7f4a08;
  --red: #a92e36;
  --side-width: 16.25rem;
  --radius: 14px;
  --font: "Aptos", "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-family: var(--font);
  font-synthesis: none;
  font-size: 100%;
  line-height: 1.5;
  color: var(--text);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4, p, ul, ol { margin-top: 0; }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.17; text-wrap: balance; }
h1 { margin-bottom: .65rem; font-size: clamp(2rem, 3.4vw, 3.3rem); letter-spacing: -.052em; font-weight: 670; }
h2 { margin-bottom: .75rem; font-size: clamp(1.35rem, 1.9vw, 1.72rem); letter-spacing: -.038em; font-weight: 680; }
h3 { margin-bottom: .55rem; font-size: 1.08rem; letter-spacing: -.015em; font-weight: 680; }
p { margin-bottom: .95rem; }
small { font-size: .84rem; }
strong { font-weight: 680; }
a { color: var(--blue); text-underline-offset: .18em; }
a:hover { color: #086692; }
hr { margin: 1.25rem 0; border: 0; border-top: 1px solid var(--line); }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid #fc9554; outline-offset: 3px; }
::selection { color: var(--navy-deep); background: #ffd5ab; }
.muted, .hint { color: var(--subtle); }
.money, .num, .number, time { font-variant-numeric: tabular-nums; }
.money, .num { white-space: nowrap; }
.num { text-align: right; }
.eyebrow, .kicker {
  margin: 0 0 .6rem;
  color: var(--blue);
  font-size: .78rem;
  font-weight: 720;
  letter-spacing: .105em;
  text-transform: uppercase;
}
.stack { display: grid; gap: 1rem; min-width: 0; }
.stack > *, .grid > *, .form-grid > * { min-width: 0; }
.stack > :last-child, .card > :last-child, .hero > :last-child { margin-bottom: 0; }

/* Navigation */
.shell { min-height: 100vh; display: grid; grid-template-columns: var(--side-width) minmax(0, 1fr); }
.sidebar {
  display: flex;
  flex-direction: column;
  position: sticky;
  z-index: 5;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  padding: 1.65rem 1.05rem 1.15rem;
  color: #eff5f9;
  background: var(--navy-deep);
  border-right: 1px solid #193b55;
  scrollbar-width: thin;
  scrollbar-color: #39546a transparent;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  width: fit-content;
  min-height: 2.8rem;
  color: var(--navy);
  font-weight: 710;
  line-height: 1.15;
  letter-spacing: -.025em;
  text-decoration: none;
}
.brand small, .brand span + small, .brand-name small { display: block; margin-top: .25rem; font-size: .78rem; font-weight: 480; letter-spacing: .035em; }
.brand img, .brand-mark, .brand-icon { width: 2.55rem; height: 2.55rem; flex: 0 0 2.55rem; }
.brand-mark, .brand-icon { display: inline-grid; place-items: center; border-radius: 10px; color: white; background: var(--blue); }
.brand-mark:empty, .brand-icon:empty { background: url("mark.svg") center/cover; }
.sidebar .brand { color: white; margin: .15rem .65rem 2.7rem; }
.sidebar .brand small { color: #bdcddd; }
.sidebar nav { display: grid; gap: .28rem; align-content: start; }
.sidebar nav :is(a,button), .sidebar .nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .7rem;
  padding: .69rem .88rem;
  width: 100%;
  min-height: 2.65rem;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #d3dfe9;
  font-size: .94rem;
  font-weight: 560;
  line-height: 1.2;
  text-decoration: none;
  text-align: left;
  background: transparent;
}
.sidebar nav :is(a,button):hover, .sidebar .nav-item:hover { color: white; background: #16354e; }
.sidebar nav :is(.active,[aria-current="page"],[aria-selected="true"]), .sidebar .nav-item.active {
  color: white;
  background: #24465e;
  border-color: #34546a;
  box-shadow: inset 3px 0 var(--accent);
}
.sidebar nav svg, .sidebar .nav-item svg { width: 1.1rem; height: 1.1rem; flex: 0 0 auto; }
.sidebar .nav-label, .sidebar .eyebrow, .sidebar nav h2, .sidebar nav h3 {
  color: #a7becf;
  margin: 1.5rem .8rem .45rem;
  font-size: .76rem;
  font-weight: 620;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.sidebar .account {
  margin-top: auto;
  padding: 1.2rem .7rem .1rem;
  padding-top: max(1.2rem, 2vh);
  color: white;
  border-top: 1px solid #2a455a;
  overflow-wrap: anywhere;
}
.sidebar nav + .account { margin-top: auto; }
.sidebar nav { margin-bottom: 2.1rem; }
.sidebar .account .muted, .sidebar .account small { color: #b7c9d7; }
.sidebar .account button, .sidebar .account a { color: #edf6ff; }
.sidebar .account button { background: #23415a; box-shadow: none; border-color: #3b5770; }
.main { min-width: 0; }
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .7rem 1.25rem;
  min-height: 4.45rem;
  padding: .8rem clamp(1rem, 3.5vw, 3.9rem);
  background: #fff;
  color: var(--subtle);
  border-bottom: 1px solid var(--line);
  font-size: .94rem;
}
.topbar select { width: auto; max-width: 100%; min-height: 2.5rem; }
.topbar > :is(p,h1,h2,h3), .topbar label { margin: 0; }
.content { width: 100%; max-width: 98rem; margin: 0 auto; padding: clamp(1.4rem, 3.1vw, 3.25rem) clamp(1rem, 3.5vw, 3.9rem) 3.8rem; }
.page-head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 1rem 1.5rem; margin-bottom: 1.65rem; }
.page-head > :is(h1,h2,p) { margin-bottom: 0; }
.page-head p:last-child { margin-bottom: 0; color: var(--subtle); }
.mobile-menu { display: none; }

/* Overview and working surfaces */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(1.4rem, 3.1vw, 2.7rem);
  background: linear-gradient(113deg,#112e49 12%,#164460 76%,#225b73 100%);
  color: #eff7fc;
  border: 1px solid #1a405a;
  border-radius: var(--radius);
}
.hero::after {
  content: "";
  pointer-events: none;
  position: absolute;
  z-index: -1;
  inset: 0 0 0 50%;
  background: repeating-linear-gradient(133deg, transparent 0 16px, #85b4c31a 17px, transparent 18px 29px);
  mask-image: linear-gradient(90deg, transparent, black);
}
.hero :is(h1,h2,h3) { color: white; }
.hero .eyebrow { color: #ffb589; }
.hero .muted, .hero p { color: #d4e4ee; }
.hero p { max-width: 58ch; }
.metrics, .grid { display: grid; gap: 1rem; }
.grid { grid-template-columns: repeat(auto-fit,minmax(min(100%, 21rem),1fr)); }
.metrics { grid-template-columns: repeat(auto-fit,minmax(min(100%, 12rem),1fr)); margin: 1.3rem 0 1.7rem; }
.metric, .card {
  min-width: 0;
  padding: clamp(1.1rem, 2vw, 1.6rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 2px 7px #112d4805;
}
.metric { position: relative; overflow: hidden; }
.metric > :is(small,label,span):first-child { display: block; color: var(--subtle); font-size: .9rem; font-weight: 610; margin-bottom: .55rem; }
.metric :is(strong,b), .metric .value {
  display: block;
  color: var(--navy);
  font-weight: 680;
  font-size: clamp(1.55rem, 2.35vw, 2.5rem);
  line-height: 1.14;
  letter-spacing: -.055em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.metric p { color: var(--subtle); font-size: .87rem; margin: .55rem 0 0; }
.metric.accent, .metric.highlight { border-color: #c1d9d2; background: #f5fbf7; }
.card + .card:not(.grid > .card,.stack > .card) { margin-top: 1rem; }
.section-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .55rem 1rem; margin-bottom: 1rem; }
.section-title h2, .section-title h3 { margin: 0; }
.card .section-title { margin-top: 0; }
.org-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.org-row:last-child { border-bottom: 0; }
.bar { display: block; min-width: 4rem; width: 100%; height: .4rem; background: #e7eef2; border-radius: 1rem; overflow: hidden; }
.bar > * { display: block; height: 100%; background: #487f98; border-radius: inherit; }
progress { accent-color: var(--blue); width: 100%; height: .6rem; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; }
.steps > * { padding: .9rem 0; border-bottom: 1px solid var(--line); }
.steps > :first-child { padding-top: .1rem; }
.steps > :last-child { border-bottom: 0; }
.badge, .status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 1.5rem;
  padding: .13rem .55rem;
  border: 1px solid #d5e3e9;
  border-radius: 2rem;
  color: #33566b;
  background: #eef4f7;
  white-space: normal;
  font-size: .8rem;
  line-height: 1.32;
  font-weight: 640;
}
:is(.status,.badge):is(.success,.ok,.approved,.green) { background: #ecf7f1; border-color: #c5e3d5; color: var(--green); }
:is(.status,.badge):is(.warning,.pending,.orange,.amber) { background: #fff3e2; border-color: #f1d8af; color: var(--amber); }
:is(.status,.badge):is(.danger,.rejected,.red) { background: #fff1f0; border-color: #f3c9c7; color: var(--red); }
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; border-bottom: 1px solid var(--line); margin: 0 0 1.3rem; }
.tabs > :is(a,button) { margin-bottom: -1px; color: var(--subtle); background: transparent; border: none; border-bottom: 2px solid transparent; border-radius: 0; box-shadow: none; }
.tabs > :is(.active,[aria-current="page"],[aria-selected="true"]) { color: var(--navy); border-bottom-color: var(--accent); }

/* Tabular and form controls */
.table-wrap { max-width: 100%; overflow: auto; scrollbar-width: thin; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .92rem; font-variant-numeric: tabular-nums; }
th, td { border-bottom: 1px solid var(--line); padding: .75rem .75rem; vertical-align: middle; }
th { color: #4e6471; background: #f3f6f8; font-size: .82rem; font-weight: 660; }
th:first-child { border-radius: 5px 0 0 0; }
th:last-child { border-radius: 0 5px 0 0; }
tbody tr:hover { background-color: #f8fafb; }
tbody tr:last-child td { border-bottom: 0; }
tfoot { font-weight: 680; background: var(--soft); }
table caption { text-align: left; padding: .5rem 0 1rem; font-weight: 650; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 14rem),1fr)); align-items: start; gap: .95rem 1rem; }
.form-grid :is(.full,.wide,.span-2,fieldset,textarea:only-child) { grid-column: 1/-1; }
fieldset { min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 1rem; margin: 0 0 1rem; }
legend { color: var(--navy); font-weight: 660; padding: 0 .35rem; }
label { display: block; font-size: .9rem; font-weight: 600; color: #344c5c; }
label > :is(input,select,textarea) { margin-top: .35rem; }
input, select, textarea {
  display: block;
  width: 100%;
  min-height: 2.7rem;
  padding: .56rem .75rem;
  border: 1px solid #afc0cb;
  border-radius: 7px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 450;
  line-height: 1.35;
  background-color: #fff;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: 2px solid #4280a3; outline-offset: 1px; border-color: #426d88; }
input:not([type=checkbox]):not([type=radio]):read-only, :is(input,textarea,select):disabled { color: #667784; background-color: #f3f6f8; }
input[type=file] { padding: .37rem; font-size: .88rem; }
input[type=file]::file-selector-button { margin-right: .65rem; padding: .3rem .55rem; border: 0; border-radius: 4px; background: #e6edf1; color: var(--navy); font: inherit; font-weight: 600; cursor: pointer; }
input:is([type=radio],[type=checkbox]) { display: inline-block; width: 1.05rem; min-height: auto; height: 1.05rem; margin: 0 .35rem 0 0; vertical-align: -.16em; accent-color: var(--blue); }
select:not([multiple]) {
  appearance: none;
  padding-right: 2.25rem;
  background-image: linear-gradient(45deg,transparent 50%,#526a7b 50%),linear-gradient(135deg,#526a7b 50%,transparent 50%);
  background-position: calc(100% - 1rem) 52%,calc(100% - .73rem) 52%;
  background-size: .28rem .28rem;
  background-repeat: no-repeat;
}
textarea { min-height: 5.5rem; resize: vertical; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
form > .actions { margin-top: 1rem; }
button, .btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .45rem;
  min-height: 2.6rem;
  padding: .54rem .91rem;
  border: 1px solid #b8c8d3;
  border-radius: 7px;
  background: #fff;
  color: var(--navy);
  font-family: inherit;
  font-size: .92rem;
  font-weight: 630;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
button:hover, .btn:hover { color: var(--navy-deep); background-color: var(--soft); border-color: #91a8b9; }
:is(button,.btn).primary, button[type=submit]:not(.secondary,.danger,.link,.nav-item) { color: #fff; background: var(--navy); border-color: var(--navy); }
:is(button,.btn).primary:hover, button[type=submit]:not(.secondary,.danger,.link,.nav-item):hover { color: #fff; background: #204c6c; border-color: #204c6c; }
:is(button,.btn).secondary { color: var(--navy); background-color: #fff; border-color: #b8c8d3; }
:is(button,.btn).danger { color: #92333a; background-color: #fff6f5; border-color: #e9c8c6; }
:is(button,.btn).link { border: 0; background: transparent; padding-inline: .25rem; text-decoration: underline; text-underline-offset: .2rem; }
:is(button,.btn):disabled, .btn[aria-disabled=true] { cursor: not-allowed; opacity: .55; }
:is(button,.btn) svg { width: 1rem; height: 1rem; }
.notice, .error, .success-message {
  padding: .83rem 1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  background: #edf5fb;
  border: 1px solid #cadce8;
  border-inline-start: 4px solid #5e8faa;
  color: #254d64;
  overflow-wrap: anywhere;
}
.error, .notice.error { background: #fff3f1; border-color: #eac9c7; border-inline-start-color: #ab4b4c; color: #8b2e38; }
.notice.success, .success-message { background: #edf8f0; border-color: #c9e4d1; border-inline-start-color: #4e9675; color: #1f6042; }
details { border-radius: 7px; }
summary { cursor: pointer; color: var(--blue); font-weight: 620; }
dialog { color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); width: min(38rem,calc(100% - 2rem)); max-height: 88dvh; padding: 1.65rem; box-shadow: 0 25px 80px #0b203543; }
dialog::backdrop { background: #0a1c31a8; }

/* Authenticator and invitation screens */
.auth-layout {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0,1.04fr) minmax(22rem,.96fr);
  align-items: stretch;
  background: #f7f9fa;
}
.auth-cover {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2.5rem,5vw,6.3rem);
  padding-bottom: clamp(7.2rem,14vw,13rem);
  background-color: var(--navy-deep);
  background-image: radial-gradient(ellipse at 14% 85%,#21465b90,transparent 43%),linear-gradient(125deg,#142e46 0%,#10293f 50%,#13364d 100%);
  color: #fff;
}
.auth-cover :is(h1,h2,h3,.brand) { color: white; }
.auth-cover h1 { max-width: 12ch; font-size: clamp(2.5rem,4.65vw,5rem); line-height: 1.01; letter-spacing: -.055em; margin: 1.1rem 0; }
.auth-cover h2 { font-size: clamp(1.9rem,3.4vw,3.4rem); }
.auth-cover p { color: #d2e2ed; max-width: 37ch; font-size: 1.05rem; }
.auth-cover .brand { margin-bottom: clamp(1.7rem,4vh,4rem); }
.auth-cover .eyebrow { color: #ffc699; font-size: .8rem; }
.auth-cover::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 44% -1% 0;
  background-image: linear-gradient(90deg,transparent calc(100% - 1px),#9dbfd324 1px),linear-gradient(0deg,transparent calc(100% - 1px),#9dbfd324 1px);
  background-size: 8.333% 25%;
  mask-image: linear-gradient(transparent 0%, black 94%);
  pointer-events: none;
}
.auth-cover::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto 0 0 0;
  height: min(28vh,18rem);
  background: linear-gradient(180deg,#ffa76e 0%, #ff9560 33%, #c48164 100%);
  clip-path: polygon(0 83%,16.67% 83%,16.67% 72%,33.33% 72%,33.33% 54%,50% 54%,50% 41%,66.67% 41%,66.67% 29%,83.33% 29%,83.33% 9%,100% 9%,100% 10.2%,83.6% 10.2%,83.6% 30.2%,66.94% 30.2%,66.94% 42.2%,50.27% 42.2%,50.27% 55.2%,33.6% 55.2%,33.6% 73.2%,16.94% 73.2%,16.94% 84.2%,0 84.2%);
  pointer-events: none;
}
.auth-card {
  align-self: center;
  justify-self: center;
  width: min(100%,33rem);
  padding: clamp(1.7rem,4vw,4.1rem);
}
.auth-card h1, .auth-card h2 { font-size: clamp(1.8rem,2.7vw,2.65rem); }
.auth-card form { display: grid; gap: 1rem; }
.auth-card form > .actions { margin-top: .25rem; }
.auth-card :is(input:not([type=checkbox],[type=radio]),button[type=submit]) { min-height: 2.9rem; }
.auth-card img[src*="qr"], .auth-card img.qr { display: block; width: min(13rem,100%); height: auto; background: #fff; border-radius: .5rem; }
.auth-card code { overflow-wrap: anywhere; white-space: normal; }
.auth-card .brand { margin-bottom: 1.5rem; }

@media (min-width: 1500px) {
  :root { --side-width: 17.25rem; }
}
@media (max-width: 1050px) {
  :root { --side-width: 13.4rem; }
  .sidebar { padding-inline: .7rem; }
  .metrics { grid-template-columns: repeat(auto-fit,minmax(min(100%,10.5rem),1fr)); }
}
@media (max-width: 780px) {
  .shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: .75rem 1rem; display: block; }
  .sidebar .brand { margin: 0; }
  .sidebar nav { display: flex; flex-wrap: nowrap; overflow: auto; scrollbar-width: thin; gap: .28rem; margin: .65rem 0 0; padding-bottom: .2rem; }
  .sidebar nav :is(a,button), .sidebar .nav-item { width: auto; flex: 0 0 auto; min-height: 2.45rem; padding: .5rem .65rem; white-space: nowrap; }
  .sidebar nav :is(.nav-label,.eyebrow,h2,h3) { display: none; }
  .sidebar .account { margin-top: .6rem; padding: .55rem 0 0; font-size: .85rem; }
  .sidebar .account:empty { display: none; }
  .sidebar .account button { min-height: 2rem; padding: .3rem .65rem; }
  .topbar { min-height: 3.2rem; padding: .65rem 1rem; }
  .page-head { align-items: flex-start; }
  .grid { grid-template-columns: minmax(0,1fr); }
  .content { padding-top: 1.35rem; }
  .auth-layout { grid-template-columns: minmax(0, .9fr) minmax(21rem,1.1fr); }
  .auth-cover { padding: 1.7rem; padding-bottom: 6rem; }
}
@media (max-width: 620px) {
  .auth-layout { display: flex; flex-direction: column; }
  .auth-cover { flex: 0 0 auto; min-height: auto; padding: 1.65rem 1.35rem; }
  .auth-cover h1 { max-width: 90%; font-size: 2.17rem; margin: .65rem 0; }
  .auth-cover p { margin-bottom: 0; font-size: .95rem; max-width: 70%; }
  .auth-cover .brand { margin-bottom: .65rem; }
  .auth-cover::before { inset: 0 0 0 48%; }
  .auth-cover::after { left: 70%; height: 35%; opacity: .75; }
  .auth-card { align-self: center; padding: 2rem 1.35rem; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; }
  .metric, .card { border-radius: 11px; }
  .metric { padding: .9rem; }
  .metric :is(strong,b), .metric .value { font-size: clamp(1.25rem,6vw,1.9rem); }
  .page-head .actions { width: 100%; }
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .table-wrap { margin-inline: -.2rem; }
  .topbar select { max-width: 80vw; }
}
@media (max-width: 350px) {
  .metrics { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  body, .shell, .main, .content { display: block; background: white; color: #111; width: 100%; margin: 0; padding: 0; }
  .sidebar, .topbar, .actions, .mobile-menu, button, dialog { display: none !important; }
  .card, .metric, .hero { box-shadow: none; border-color: #bbb; break-inside: avoid; }
  th, td { padding: .35rem .4rem; }
  .hero { background: #eef3f6; color: #111; }
  .hero :is(h1,h2,h3,p) { color: #111; }
  .table-wrap { overflow: visible; }
}
