:root {
  font-family: "Inter", "Segoe UI", "Malgun Gothic", system-ui, sans-serif;
  color: #172c32;
  background: #f3f6f5;
  line-height: 1.45;
  color-scheme: light;
  --muted: #526b70;
  --edge: #dae4e1;
  --green: #106756;
  --nav: #102e33;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
a {
  color: var(--green);
}
button {
  cursor: pointer;
}
.sr,
.skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.skip:focus {
  position: absolute;
  z-index: 5;
  background: white;
  padding: 10px;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid #2187a3;
  outline-offset: 3px;
}
button:disabled,
input:disabled {
  cursor: default;
  opacity: 0.58;
}
h1,
h2,
h3,
p {
  margin: 0;
}
.button {
  border: 1px solid #ccd9d5;
  background: white;
  color: #21443d;
  font-weight: 650;
  text-decoration: none;
  min-height: 40px;
  padding: 9px 15px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.button:hover {
  background: #f2f7f5;
}
.primary {
  background: #146b56;
  border-color: #146b56;
  color: white;
  box-shadow: 0 2px 4px #133e2e15;
}
.primary:hover {
  background: #0c5746;
}
.button b {
  font-size: 18px;
  line-height: 1;
}
.shell {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  min-height: 100vh;
}
.side {
  background: var(--nav);
  color: #f3faf7;
  display: flex;
  flex-direction: column;
  padding: 32px 18px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand strong {
  font-size: 37px;
  line-height: 1;
  font-weight: 760;
  letter-spacing: -2px;
}
.side .brand {
  padding: 5px 13px 41px;
}
.mark {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  width: 36px;
  height: 35px;
  background: #c1f281;
  border-radius: 10px;
  padding: 9px 7px;
  transform: rotate(-4deg);
}
.mark b {
  display: block;
  background: #12382d;
  width: 5px;
  border-radius: 2px;
  transform: skew(-11deg);
  height: 12px;
}
.mark b:nth-child(2) {
  height: 18px;
}
.mark b:last-child {
  height: 15px;
}
.side-label {
  font-size: 11px;
  font-weight: 650;
  color: #a4bfbc;
  margin: 8px 14px 12px;
}
.side nav {
  display: grid;
  gap: 5px;
}
.side nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #bfd1ce;
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
}
.side nav a[aria-current="page"] {
  background: #24514f;
  color: #e9f8df;
}
.nav-icon {
  position: relative;
  width: 15px;
  height: 15px;
  display: inline-block;
}
.tile-icon:after {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: currentColor;
  box-shadow:
    8px 0 currentColor,
    0 8px currentColor,
    8px 8px currentColor;
}
.log-icon {
  border: 1.5px solid currentColor;
  border-radius: 3px;
}
.log-icon:after {
  content: "";
  position: absolute;
  left: 3px;
  top: 4px;
  width: 7px;
  height: 1px;
  background: currentColor;
  box-shadow: 0 4px currentColor;
}
.operator {
  margin-top: auto;
  border-top: 1px solid #365154;
  padding: 18px 2px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.avatar {
  font-style: normal;
  font-weight: 700;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #dbdfc4;
  color: #28463b;
  font-size: 13px;
}
.operator div {
  min-width: 0;
}
.operator small,
.operator span {
  display: block;
}
.operator small {
  font-size: 10px;
  color: #b2c6bf;
}
.operator span {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.signout {
  color: #cfddd9;
  background: transparent;
  border: 0;
  margin-left: auto;
  font-size: 20px;
}
.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4%;
  background: #fff;
  border-bottom: 1px solid var(--edge);
  font-size: 12px;
  color: var(--muted);
}
.topbar b {
  font-weight: 400;
  color: #99aca8;
  margin: 0 8px;
}
.mode {
  font-size: 11px;
  border: 1px solid #cddad5;
  padding: 4px 9px;
  border-radius: 20px;
  color: #3a5349;
  background: #f6faf7;
}
.mode:before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7b9e39;
  margin-right: 6px;
}
.main-inner {
  max-width: 1340px;
  margin: auto;
  padding: 31px 4% 54px;
}
.page-title,
.panel-title,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.page-title {
  margin-bottom: 18px;
}
.page-title h1,
.gate h1 {
  font-size: clamp(28px, 3vw, 39px);
  letter-spacing: -0.07em;
  line-height: 1.25;
}
.metrics {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 13px;
  margin-bottom: 25px;
}
.metric {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--edge);
  border-radius: 13px;
  min-height: 110px;
  padding: 18px 20px;
}
.metric:first-child {
  background: #164c43;
  border-color: #164c43;
  color: #fff;
}
.metric span {
  display: block;
  font-size: 12px;
  font-weight: 650;
  color: #4d625e;
}
.metric:first-child span {
  color: #c7e1d4;
}
.metric strong {
  font-size: 36px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  letter-spacing: -0.065em;
}
.metric small {
  font-size: 11px;
  color: var(--muted);
  margin-left: 5px;
}
.metric:first-child small {
  color: #d1e8d9;
}
.stat-shape {
  position: absolute;
  right: 20px;
  top: 22px;
  width: 16px;
  height: 16px;
  border: 2px solid #5d887c;
  border-radius: 4px;
}
.metric:first-child .stat-shape {
  width: 50px;
  height: 50px;
  top: auto;
  bottom: -13px;
  right: 9px;
  border: 1px solid #75a68a;
  border-radius: 9px;
  transform: rotate(-27deg);
  box-shadow:
    7px -10px 0 -1px #164c43,
    7px -10px 0 0 #75a68a,
    14px -20px 0 -1px #164c43,
    14px -20px 0 0 #75a68a;
}
.metric:nth-child(2) .stat-shape {
  border-radius: 50%;
  border-color: #619e87;
}
.metric:nth-child(2) .stat-shape:after {
  content: "";
  position: absolute;
  width: 6px;
  height: 3px;
  border-bottom: 1.5px solid #56856d;
  border-left: 1.5px solid #56856d;
  transform: rotate(-45deg);
  left: 3px;
  top: 3px;
}
.metric:nth-child(3) .stat-shape {
  border-color: #ba9654;
  transform: rotate(45deg);
}
.panel {
  background: white;
  border: 1px solid var(--edge);
  border-radius: 15px;
  overflow: hidden;
}
.panel-title {
  padding: 19px 22px 10px;
  justify-content: flex-start;
}
.panel-title h2,
.drawer-section h3 {
  font-size: 18px;
  letter-spacing: -0.04em;
}
.panel-title span {
  font-size: 12px;
  color: var(--muted);
}
.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 5px 22px 11px;
}
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #cbd9d5;
  border-radius: 8px;
  max-width: 400px;
  flex: 1;
  min-width: 0;
  padding: 0 13px;
  background: #fbfcfb;
}
.search i {
  position: relative;
  width: 12px;
  height: 12px;
  border: 1.5px solid #68827b;
  border-radius: 50%;
  flex: none;
}
.search i:after {
  content: "";
  position: absolute;
  background: #68827b;
  width: 6px;
  height: 1.5px;
  transform: rotate(45deg);
  right: -4px;
  bottom: -2px;
}
.search input {
  border: 0;
  background: transparent;
  min-width: 0;
  width: 100%;
  font-size: 13px;
  height: 37px;
  color: inherit;
}
.controls select,
select.field-control {
  border: 1px solid #cbd9d5;
  border-radius: 8px;
  background: white;
  padding: 8px 24px 8px 9px;
  color: inherit;
  font-size: 13px;
}
.filters {
  margin: 0 22px;
  display: flex;
  gap: 18px;
  overflow-x: auto;
}
.filters button {
  white-space: nowrap;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: #536c64;
  padding: 9px 1px;
  font-size: 13px;
  font-weight: 600;
}
.filters button[aria-pressed="true"] {
  border-color: var(--green);
  color: #115b4c;
}
.tablewrap {
  width: 100%;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th {
  background: #f4f7f5;
  color: #526860;
  font-size: 11px;
  font-weight: 650;
}
th,
td {
  padding: 10px 14px;
  border-bottom: 1px solid #e8efeb;
}
th:first-child,
td:first-child {
  padding-left: 22px;
}
td {
  font-size: 13px;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #f8fbf9;
}
.app-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.app-link:hover strong {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.app-link strong,
.app-link small {
  display: block;
}
.app-link strong {
  font-size: 14px;
}
.app-link small {
  font-size: 11px;
  color: var(--muted);
}
.app-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid #192b2112;
  object-fit: cover;
  flex: none;
}
.letter {
  display: inline-grid;
  place-items: center;
  font-weight: 750;
  letter-spacing: -1px;
  font-size: 15px;
  background: #dcebed;
  color: #315966;
}
.letter.ink {
  background: #243847;
  color: #c7eacb;
}
.letter.rose {
  background: #fae3e4;
  color: #89534f;
}
.letter.amber {
  background: #f9e8b5;
  color: #715211;
}
.pill {
  font-size: 11px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  padding: 3px 9px;
  background: #e7f4eb;
  color: #246445;
  font-weight: 650;
}
.pill:before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.pill.pending {
  background: #fff0d4;
  color: #825909;
}
.pill.reference {
  background: #e8edf5;
  color: #505e84;
}
.open-detail {
  font-size: 20px;
  text-decoration: none;
  color: #637c74;
  padding: 4px;
}
.empty {
  padding: 37px 22px;
  color: var(--muted);
  text-align: center;
}
.notice,
.error:not(:empty) {
  padding: 11px 14px;
  border-radius: 8px;
  background: #edf4e9;
  color: #26593c;
  font-size: 13px;
}
.notice {
  margin-bottom: 12px;
}
.error:not(:empty) {
  background: #ffede7;
  color: #8b3829;
}
.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: linear-gradient(128deg, #102e33 0 42%, #17443e 75%, #275244);
}
.gate-card {
  border-top: 5px solid #bdec82;
  width: min(430px, 100%);
  padding: 38px;
  border-radius: 18px;
  background: #f6f8f3;
  box-shadow: 0 20px 65px #0a1b2140;
}
.gate-copy {
  margin: 52px 0 25px;
}
.gate-copy h1 {
  margin: 6px 0 12px;
}
.gate-copy p {
  color: var(--muted);
  font-size: 14px;
}
.gate-copy .address {
  font-size: 12px;
  letter-spacing: 0.025em;
}
.gate .button {
  width: 100%;
}
#signinForm,
.gate-fields {
  display: grid;
  gap: 15px;
}
#signinForm .field {
  display: grid;
  gap: 6px;
}
.enroll-qr {
  display: block;
  width: min(200px, 100%);
  height: auto;
  margin: 0 auto 12px;
  background: white;
}
#manualSetup {
  font-size: 14px;
}
#manualSetup summary {
  cursor: pointer;
  color: var(--green);
}
#setupKey {
  display: block;
  overflow-wrap: anywhere;
  padding: 10px 0;
  user-select: all;
}
#manualSetup p {
  color: var(--muted);
}
#loginOtp {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.18em;
}
.gate .error:not(:empty) {
  margin-top: 12px;
}
dialog {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(530px, 100%);
  height: 100dvh;
  max-width: 100%;
  max-height: 100dvh;
  margin: 0;
  border: 0;
  padding: 0;
  color: inherit;
  box-shadow: -16px 0 55px #102e3322;
  overflow: auto;
}
dialog::backdrop {
  background: #0c292b70;
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--edge);
  padding: 13px 23px;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.drawer-head span {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}
.close {
  font-size: 24px;
  background: #f4f7f5;
  border: 0;
  width: 33px;
  height: 33px;
  border-radius: 8px;
  color: #3f5b53;
}
#drawerBody {
  padding: 25px;
}
.drawer-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0 0 19px;
}
.drawer-heading .app-icon {
  width: 49px;
  height: 49px;
  border-radius: 12px;
}
.drawer-heading h2 {
  font-size: 25px;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}
.drawer-heading p,
.form-hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}
.drawer-section {
  border-top: 1px solid var(--edge);
  padding: 18px 0 5px;
  margin-top: 18px;
}
.drawer-section h3 {
  margin-bottom: 10px;
  font-size: 15px;
}
.facts {
  margin: 0;
}
.facts div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 13px;
  padding: 6px 0;
  font-size: 13px;
}
.facts dt {
  color: var(--muted);
}
.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.facts code {
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 12px;
}
.field {
  display: grid;
  gap: 5px;
  margin: 12px 0;
  color: #34534b;
  font-weight: 650;
  font-size: 13px;
}
.field input,
.field select {
  width: 100%;
  height: 40px;
  border: 1px solid #c3d2cd;
  border-radius: 7px;
  padding: 7px 10px;
  background: #fff;
  color: #183b31;
  font-weight: 400;
}
.field input:read-only,
.field input:disabled {
  background: #f1f5f2;
}
.form-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 21px;
}
.check-line {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #76551a;
  margin: 9px 0;
}
.log-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(120px, 1fr) minmax(
      90px,
      0.9fr
    );
  gap: 12px;
  align-items: start;
  padding: 14px 22px;
  border-top: 1px solid var(--edge);
  font-size: 13px;
}
.log-row small,
.log-row time {
  font-size: 12px;
  color: var(--muted);
}
.log-row strong,
.log-row small {
  display: block;
  overflow-wrap: anywhere;
}
.warn {
  padding: 10px 12px;
  background: #fff5df;
  color: #80552b;
  border-radius: 6px;
  font-size: 12px;
  margin: 10px 0;
}
@media (max-width: 820px) {
  .shell {
    grid-template-columns: 164px minmax(0, 1fr);
  }
  .side {
    padding: 24px 10px 15px;
  }
  .main-inner {
    padding: 24px 3% 40px;
  }
  .side .brand {
    padding-left: 8px;
  }
  .metrics {
    gap: 8px;
  }
  .metric {
    padding: 15px;
  }
  .apps-table th:nth-child(2),
  .apps-table td:nth-child(2) {
    display: none;
  }
}
@media (max-width: 620px) {
  .shell {
    display: block;
  }
  .side {
    position: static;
    height: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    flex-wrap: wrap;
  }
  .side .brand {
    padding: 0;
    margin-right: auto;
  }
  .side .brand strong {
    font-size: 25px;
  }
  .side .mark {
    width: 25px;
    height: 25px;
    border-radius: 6px;
    gap: 2px;
    padding: 5px;
  }
  .side .mark b {
    width: 3px;
    height: 9px;
  }
  .side .mark b:nth-child(2) {
    height: 13px;
  }
  .side .mark b:last-child {
    height: 10px;
  }
  .side-label,
  .operator .avatar,
  .operator div,
  .side nav .nav-icon {
    display: none;
  }
  .side nav {
    display: flex;
    gap: 3px;
  }
  .side nav a {
    font-size: 12px;
    padding: 7px 9px;
  }
  .operator {
    margin: 0;
    padding: 0;
    border: 0;
  }
  .topbar {
    min-height: 43px;
    padding: 0 14px;
    font-size: 11px;
  }
  .main-inner {
    padding: 21px 12px 32px;
  }
  .page-title h1 {
    font-size: 28px;
  }
  .metrics {
    gap: 6px;
    margin-bottom: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .metric {
    padding: 10px 9px;
    min-height: 80px;
    border-radius: 9px;
  }
  .metric span {
    font-size: 11px;
  }
  .metric strong {
    font-size: 27px;
  }
  .metric .stat-shape {
    display: none;
  }
  .panel-title {
    padding: 14px 12px 8px;
  }
  .controls {
    margin: 4px 12px 7px;
    gap: 5px;
  }
  .controls select {
    max-width: 110px;
    font-size: 12px;
    padding-right: 5px;
  }
  .search {
    padding: 0 9px;
  }
  .search input {
    font-size: 12px;
  }
  .filters {
    margin: 0 12px;
    gap: 11px;
  }
  .filters button {
    font-size: 12px;
  }
  th,
  td {
    padding: 9px 4px;
  }
  th:first-child,
  td:first-child {
    padding-left: 12px;
  }
  .apps-table th:last-child,
  .apps-table td:last-child {
    padding-right: 9px;
  }
  .app-link {
    gap: 8px;
  }
  .app-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }
  .app-link strong {
    font-size: 13px;
  }
  .app-link small {
    font-size: 10px;
  }
  .pill {
    font-size: 10px;
    padding: 3px 6px;
  }
  .page-title .button {
    font-size: 13px;
    padding: 7px 10px;
  }
  .gate-card {
    padding: 27px;
  }
  .facts div {
    grid-template-columns: 95px 1fr;
  }
  .log-row {
    grid-template-columns: 1fr 1fr;
    padding: 12px;
  }
  .log-row time {
    grid-column: 1/-1;
  }
  .drawer-head {
    padding: 11px 16px;
  }
  #drawerBody {
    padding: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
.refresh {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  background: #fff;
  color: #315e51;
  border: 1px solid var(--edge);
  border-radius: 6px;
  padding: 5px 9px;
}
.refresh:hover {
  background: #f2f7f4;
}
.metrics.has-reference {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 620px) {
  .metrics.has-reference {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
