:root {
  color-scheme: light;
  --ink: #152233;
  --muted: #506174;
  --surface: #fff;
  --canvas: #f2f6fa;
  --line: #dbe4ec;
  --nav: #102335;
  --teal: #08766a;
  --teal-dark: #075950;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.75rem, 3vw, 2.5rem); letter-spacing: -.045em; line-height: 1.1; }
h2 { font-size: 1.05rem; letter-spacing: -.015em; }
a { color: var(--teal-dark); text-underline-offset: .2em; }
a:hover { color: #073e37; }
:focus-visible { outline: 3px solid #028c9a; outline-offset: 3px; }
.visually-hidden, .skip-link:not(:focus) {
  position: absolute; height: 1px; width: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.skip-link:focus { position: fixed; z-index: 3; top: .5rem; left: .5rem; padding: .75rem; background: white; }
.sidebar {
  width: 15rem; height: 100vh; position: fixed; inset: 0 auto 0 0;
  background: var(--nav); color: #e3edf7; display: flex; flex-direction: column; padding: 1.55rem 1rem;
}
.brand { display: flex; gap: .7rem; align-items: center; color: white; font-weight: 760; font-size: 1.22rem; text-decoration: none; }
.sidebar .brand { padding: 0 .65rem; margin-bottom: 2.6rem; }
.brand:hover { color: #fff; }
.brand-icon {
  display: grid; place-items: center; width: 2rem; height: 2rem; background: #54e2cb;
  border-radius: .55rem; color: #153938; font-weight: 850; font-size: .99rem;
}
.sidebar nav { display: grid; gap: .35rem; }
.sidebar nav a {
  color: #d1dfe9; text-decoration: none; border-radius: .55rem; display: flex;
  align-items: center; gap: .8rem; padding: .78rem .75rem; font-size: .91rem; font-weight: 590;
}
.sidebar nav a:hover, .sidebar nav a.current { background: #244354; color: white; }
.sidebar nav a.current { box-shadow: inset .19rem 0 #54e2cb; }
.nav-icon { width: .95rem; height: .95rem; display: inline-block; flex: 0 0 .95rem; position: relative; }
.nav-overview { border: 1.5px solid currentColor; border-radius: .19rem; }
.nav-overview::after { content: ""; position: absolute; top: 42%; left: 0; width: 100%; border-top: 1.5px solid; }
.nav-people::before, .nav-people::after { content: ""; position: absolute; border: 1.5px solid; }
.nav-people::before { width: .36rem; height: .36rem; border-radius: 50%; top: 0; left: .22rem; }
.nav-people::after { width: .86rem; height: .30rem; bottom: 0; border-radius: .4rem .4rem .16rem .16rem; }
.nav-screen { border: 1.5px solid; border-radius: .18rem; height: .71rem; }
.nav-screen::after { content: ""; position: absolute; left: .22rem; bottom: -.23rem; width: .38rem; border-top: 1.5px solid; }
.sidebar-user { display: flex; align-items: center; gap: .65rem; margin-top: auto; border-top: 1px solid #345064; padding: .95rem .35rem 0; min-width: 0; }
.sidebar-user strong { font-size: .88rem; overflow-wrap: anywhere; }
.avatar { display: grid; place-items: center; border-radius: 50%; width: 2rem; height: 2rem; flex: 0 0 2rem; background: #29485b; font-weight: 700; }
.signout { padding: .2rem 0; color: #c4d7e5; background: none; border: 0; cursor: pointer; font: inherit; font-size: .83rem; text-decoration: underline; text-underline-offset: .2em; }
.workspace { margin-left: 15rem; padding: 2.6rem clamp(1.25rem, 3.4vw, 3.5rem); max-width: 100rem; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; flex-wrap: wrap; margin: 0 0 1.6rem; }
.page-header p { margin-top: .55rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 2.55rem; padding: .53rem .9rem; border-radius: .5rem; border: 1px solid #bdccd9;
  background: var(--surface); color: var(--ink); text-decoration: none; font: inherit; font-size: .91rem;
  font-weight: 640; cursor: pointer; white-space: nowrap;
}
.button:hover { background: #edf4f9; }
.button.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.button.primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.button.simple { border-color: transparent; background: none; color: var(--teal-dark); }
.back { display: inline-block; margin-bottom: .9rem; font-size: .91rem; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.stat, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; min-width: 0; box-shadow: 0 2px 8px #17354b08; }
.stat { display: flex; flex-direction: column; gap: .5rem; padding: 1.12rem 1.15rem; min-height: 8.2rem; }
.stat p { font-size: .9rem; font-weight: 630; color: var(--muted); }
.stat strong { font-size: 2.05rem; font-weight: 730; font-variant-numeric: tabular-nums; line-height: 1.1; letter-spacing: -.04em; }
.stat a { font-size: .87rem; align-self: start; }
.stat.positive { background: #eaf7f3; border-color: #afdbd1; }
.stat.positive strong { color: #075d50; }
.overview { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.panel-heading { padding: 1.1rem 1.15rem; }
.scroll { overflow-x: auto; }
table { border-spacing: 0; width: 100%; font-size: .92rem; text-align: left; }
thead { background: #f5f8fb; color: #3d5366; }
th, td { padding: .84rem 1.05rem; border-top: 1px solid #e5ebf1; vertical-align: top; }
th { font-size: .87rem; font-weight: 690; }
td a { color: #0c5f58; font-weight: 630; }
td, .facts dd, .plain-list { overflow-wrap: anywhere; }
.cell-note { display: block; color: var(--muted); font-size: .81rem; margin-top: .27rem; }
.badge { display: inline-block; padding: .18rem .48rem; background: #e8eef4; color: #344a5c; border-radius: .32rem; font-size: .875rem; white-space: nowrap; font-weight: 620; }
.badge.blue { color: #204c71; background: #e8f1fa; }
.badge.green { color: #116051; background: #e6f5ef; }
.badge.amber { color: #764007; background: #fff0d8; }
.empty { color: var(--muted); padding: 1.15rem; }
.plain-list { margin: 0; list-style: none; padding: 0 1.15rem .65rem; }
.plain-list li { padding: .7rem 0; border-top: 1px solid var(--line); }
.plain-list small { display: block; color: var(--muted); margin-top: .3rem; }
.search, .pagination { display: flex; align-items: center; gap: .6rem; padding: .9rem 1.1rem; flex-wrap: wrap; }
.pagination { justify-content: space-between; font-size: .9rem; color: var(--muted); border-top: 1px solid var(--line); }
.search input { width: min(100%, 21rem); }
input, select, textarea {
  max-width: 100%; border-radius: .45rem; border: 1px solid #aebfcd; background: #fff; color: var(--ink);
  min-height: 2.6rem; padding: .55rem .7rem; font: inherit;
}
textarea { resize: vertical; }
.form-panel { max-width: 43rem; padding: 1.3rem; }
.fields { display: grid; gap: 1.05rem; }
.fields label { font-size: .93rem; font-weight: 670; display: block; margin: 0 0 .4rem; }
.fields input:not([type="hidden"]), .fields select, .fields textarea { width: 100%; }
.fields .helptext { font-size: .87rem; color: var(--muted); }
.errorlist { margin: 0 0 .4rem; padding-left: 1.2rem; color: #8a2525; font-size: .92rem; }
.notice { border-radius: .55rem; margin-bottom: 1.1rem; padding: .8rem .9rem; border: 1px solid #cbdce9; color: #1d4865; background: #edf6ff; }
.notice.success { color: #125848; background: #ecf8f2; border-color: #b9ddcf; }
.notice.error { color: #862525; background: #fff1ef; border-color: #efc4be; }
.notice.warning { color: #74480c; background: #fff5e5; border-color: #eed7b0; }
.facts { margin: 0; padding: 1.1rem 1.15rem; display: flex; gap: 1rem 2.5rem; flex-wrap: wrap; }
.facts dt { font-size: .9rem; color: var(--muted); font-weight: 620; }
.facts dd { margin: .25rem 0 0; }
.history { margin-top: 1.15rem; }
.signin-page { background: radial-gradient(ellipse at top left, #d9f2ec, #f4f8fb 60%); }
.signin-wrap { min-height: 100vh; display: grid; place-content: center; padding: 1.25rem; }
.signin-card { border: 1px solid var(--line); padding: clamp(1.4rem, 4vw, 2.25rem); width: min(27rem, calc(100vw - 2.5rem)); border-radius: .9rem; background: #fff; box-shadow: 0 12px 35px #17354b13; }
.brand-dark { color: var(--ink); margin-bottom: 1.7rem; }
.signin-card h1 { font-size: 2rem; margin-bottom: 1.4rem; }
@media (max-width: 1050px) {
  .overview { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .sidebar { position: static; width: auto; height: auto; padding: .82rem; gap: .65rem; display: grid; grid-template-columns: 1fr auto; }
  .sidebar .brand { margin: 0; padding: 0; }
  .sidebar nav { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: wrap; }
  .sidebar nav a { padding: .62rem .58rem; font-size: .86rem; gap: .4rem; }
  .sidebar-user { padding: 0; border: 0; grid-column: 2; grid-row: 1; }
  .avatar { display: none; }
  .workspace { margin: 0; padding: 1.3rem .9rem; }
  .stat-grid { gap: .6rem; }
  .stat { padding: .8rem; min-height: 6.8rem; }
  th, td { padding: .7rem .6rem; }
}

.nav-file { border: 1.5px solid; border-radius: .17rem; width: .77rem; height: .95rem; }
.nav-file::after { content: ""; position: absolute; inset: .32rem .16rem auto; height: .23rem; border-block: 1.5px solid; }
.import-filename { overflow-wrap: anywhere; }
.import-stats .stat { min-height: 6.3rem; }
.import-upload input[type="file"] { min-width: 0; }
.import-table { min-width: 43rem; }
.import-select { display: inline-flex; min-width: 2.75rem; min-height: 2.75rem; align-items: center; justify-content: center; }
.import-select input { min-height: 1.15rem; width: 1.15rem; accent-color: var(--teal); }
.import-actions { border-top: 1px solid var(--line); padding: .9rem 1.1rem; }
.scroll:focus-visible { outline-offset: -3px; }

@media (max-width: 700px) {
  .sidebar { grid-template-columns: minmax(0, 1fr) minmax(0, 45%); }
  .sidebar nav a { min-height: 2.75rem; }
  .page-header > div { min-width: 0; }
  .button { min-height: 2.75rem; white-space: normal; text-align: center; }
  .overview > .panel { min-width: 0; }
  .import-actions { padding-inline: .7rem; }
}
