:root {
  --bg: #f6f8fa;
  --ink: #17252c;
  --muted: #75818b;
  --line: #e7eced;
  --green: #087f68;
  --green-dark: #05624f;
  --sidebar: #142c2a;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  color: var(--ink);
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
}
[hidden] {
  display: none !important;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--green);
}
a {
  color: inherit;
  text-decoration: none;
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-size: 29px;
  letter-spacing: -0.7px;
  font-weight: 650;
  line-height: 1.4;
}
h2 {
  font-size: 16px;
  font-weight: 650;
}
small {
  font-size: 12px;
}
.muted {
  color: var(--muted);
  line-height: 1.7;
}
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.8px;
  color: var(--green);
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #36c3a0;
  color: #102c27;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -1px;
  flex-shrink: 0;
}
.button {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  min-height: 40px;
}
.primary {
  background: var(--green);
  color: white;
  box-shadow: 0 2px 3px #087f6812;
}
.primary:hover {
  background: var(--green-dark);
}
.secondary {
  background: white;
  border-color: #dbe3e3;
  color: #52606a;
}
.secondary:hover {
  background: #f3f7f6;
}
.danger {
  background: #b73838;
  color: white;
}
.danger:hover {
  background: #952b2b;
}
.wide {
  width: 100%;
}
.icon-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 21px;
  min-width: 34px;
  min-height: 34px;
  border-radius: 6px;
}
.icon-button:hover {
  background: #edf4f1;
  color: var(--green);
}
.form-error {
  font-size: 12px;
  color: #b33636;
  min-height: 18px;
  margin: 12px 0;
  line-height: 1.6;
}
.notice {
  padding: 12px 16px;
  background: #e9f6f0;
  border: 1px solid #cce6da;
  border-radius: 8px;
  margin-bottom: 20px;
  color: #26634c;
  line-height: 1.6;
}
.notice.error {
  background: #fff0ee;
  color: #a63c36;
  border-color: #f1d7d3;
}
.app {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--sidebar);
  color: #adbfbb;
  padding: 32px 20px 24px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: #fff;
  font-size: 19px;
  font-weight: 650;
  padding: 0 4px;
}
.brand small {
  display: block;
  color: #78978f;
  font-size: 10px;
  margin-top: 5px;
  letter-spacing: 2px;
  font-weight: 400;
}
.nav-label {
  font-size: 10px;
  color: #688b81;
  letter-spacing: 1.5px;
  margin: 46px 14px 14px;
}
.nav-item {
  display: flex;
  gap: 13px;
  align-items: center;
  width: 100%;
  border: 0;
  background: none;
  color: #a5bbb3;
  text-align: left;
  border-radius: 8px;
  padding: 13px 14px;
  margin: 4px 0;
  font-weight: 500;
  font-size: 13px;
}
.nav-item span {
  font-size: 21px;
  width: 23px;
  text-align: center;
  font-weight: 400;
  line-height: 1;
}
.nav-item:hover {
  background: #1e3934;
  color: #fff;
}
.nav-item.active {
  background: #26443c;
  color: #7be2b8;
  box-shadow: inset 3px 0 #55c799;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 20px 12px 0;
  border-top: 1px solid #2a423d;
}
.connection {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #a3bfb3;
}
.dot {
  width: 6px;
  height: 6px;
  display: inline-block;
  background: #5fd6a4;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #5fd6a414;
}
.sidebar-version {
  display: block;
  font: 10px var(--mono);
  color: #66887c;
  margin: 12px 0 22px;
}
.logout {
  background: none;
  border: 0;
  color: #91a89f;
  font-size: 12px;
  padding: 0;
}
.logout:hover {
  color: white;
}
.topbar {
  height: 74px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  font-size: 12px;
  color: #93a09f;
}
.topbar strong {
  font-weight: 500;
  color: #465854;
}
.crumb {
  padding: 0 14px;
  color: #c9d2d1;
}
.admin-badge {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #52615b;
}
.avatar {
  background: #edf4f0;
  color: #438a6b;
  width: 29px;
  height: 29px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d9e8df;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
}
.content {
  max-width: 1540px;
  margin: auto;
  padding: 34px 40px 20px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
.page-heading h1 {
  margin-top: 5px;
  margin-bottom: 8px;
}
.page-heading .muted {
  font-size: 12px;
}
.heading-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}
.updated {
  font-size: 10px;
  color: #9aa5aa;
  margin-right: 8px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}
.metric,
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 3px 8px #142c2a02;
}
.metric {
  padding: 21px 22px;
}
.metric-label {
  font-size: 12px;
  color: #63756e;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.metric-label span {
  font-size: 18px;
  color: #80a898;
}
.metric strong {
  display: block;
  font-size: 31px;
  letter-spacing: -1px;
  font-weight: 600;
  margin: 14px 0 8px;
  font-variant-numeric: tabular-nums;
}
.metric small {
  color: #9aa49f;
  font-size: 10px;
}
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  align-items: start;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 23px 24px;
  gap: 12px;
}
.panel-heading p {
  font-size: 11px;
  color: #8b9891;
  margin-top: 6px;
}
.tag {
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  line-height: 1.5;
  border-radius: 5px;
  background: #e9f7ef;
  color: #25895e;
  white-space: nowrap;
}
.tag.neutral {
  background: #f2f5f4;
  color: #7c8d85;
}
.tag.expired {
  background: #f3f1ed;
  color: #937c50;
}
.tag.exhausted {
  background: #fff0ed;
  color: #b36151;
}
.table-wrap {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 12px;
}
th {
  font-size: 10px;
  font-weight: 500;
  color: #8a9992;
  background: #fafcfb;
  padding: 12px 23px;
  border-top: 1px solid #f1f4f2;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 18px 23px;
  border-bottom: 1px solid #eff3f1;
  line-height: 1.6;
  vertical-align: middle;
}
tbody tr:last-child td {
  border-bottom: 0;
}
td strong {
  font-size: 12px;
  font-weight: 600;
}
td small {
  display: block;
  color: #8a9891;
  font-size: 10px;
  margin-top: 3px;
}
.align-right {
  text-align: right;
}
.mono {
  font-family: var(--mono);
  font-size: 10px;
  color: #65796f;
}
.empty {
  padding: 65px 20px;
  text-align: center;
  color: #9aa8a1;
}
.empty strong {
  display: block;
  margin-bottom: 7px;
  color: #63786c;
  font-weight: 500;
  font-size: 13px;
}
.panel-foot {
  font-size: 10px;
  color: #94a198;
  padding: 15px 24px;
  border-top: 1px solid var(--line);
}
.overview-aside {
  display: grid;
  gap: 18px;
}
.access-card {
  padding-bottom: 22px;
}
.access-card .panel-heading {
  padding-bottom: 14px;
}
.access-card > .muted {
  font-size: 12px;
  padding: 0 24px;
  margin-bottom: 20px;
}
.access-card > label {
  font-size: 10px;
  color: #87998f;
  padding: 0 24px;
}
.endpoint {
  margin: 8px 24px 17px;
  display: flex;
  border: 1px solid #dfe9e3;
  background: #f6faf7;
  border-radius: 6px;
  padding: 4px 4px 4px 10px;
  align-items: center;
  gap: 5px;
}
.endpoint code {
  overflow-wrap: anywhere;
  flex: 1;
  font: 10px/1.7 var(--mono);
  color: #47745c;
}
.protocols {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 24px;
}
.protocols span {
  padding: 4px 6px;
  font-size: 9px;
  color: #89988e;
  background: #f4f7f4;
  border-radius: 4px;
}
.security-card {
  background: #edf5ef;
  border: 1px solid #dce9df;
  border-radius: 12px;
  padding: 23px;
}
.security-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  color: #2c9366;
  background: #d8ede0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.security-card h2 {
  font-size: 14px;
  color: #376b4c;
  margin-bottom: 9px;
}
.security-card p {
  font-size: 11px;
  line-height: 1.9;
  color: #769480;
}
.text-button {
  background: none;
  border: 0;
  padding: 0;
  color: #328358;
  font-size: 11px;
  font-weight: 600;
  margin-top: 18px;
}
.fine-print {
  font-size: 10px;
  color: #9aa79f;
  line-height: 1.8;
  margin-top: 19px;
}
.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 46px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: #a3aea7;
}
.key-toolbar {
  padding: 20px 24px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fafcfb;
  border: 1px solid #dde6df;
  border-radius: 7px;
  padding-left: 12px;
  max-width: 310px;
  flex: 1;
  color: #879d8d;
}
.search-box input {
  border: 0 !important;
  background: none !important;
  margin: 0 !important;
  padding: 9px !important;
  min-width: 0;
}
.key-toolbar select {
  width: 125px;
}
.key-toolbar > .muted {
  margin-left: auto;
  font-size: 11px;
}
.keys-table {
  min-width: 890px;
}
.keys-table td {
  padding-top: 21px;
  padding-bottom: 21px;
}
.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.row-actions button {
  border: 1px solid #e0e8e1;
  background: white;
  color: #6e8975;
  border-radius: 5px;
  padding: 5px 8px;
  font-size: 10px;
}
.row-actions button:last-child {
  color: #b16a60;
}
.row-actions button:hover {
  background: #f5f8f5;
}
.budget {
  min-width: 125px;
}
.budget progress {
  display: block;
  width: 100%;
  height: 4px;
  border: 0;
  border-radius: 5px;
  margin-top: 7px;
  appearance: none;
  background: #edf3ee;
}
.budget progress::-webkit-progress-bar {
  background: #edf3ee;
  border-radius: 5px;
}
.budget progress::-webkit-progress-value {
  background: #60b793;
  border-radius: 5px;
}
.budget progress::-moz-progress-bar {
  background: #60b793;
  border-radius: 5px;
}
.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.model-card {
  padding: 26px;
}
.model-card .model-symbol {
  font-size: 26px;
  color: #41a482;
  margin-bottom: 25px;
  display: block;
}
.model-card h2 {
  font-family: var(--mono);
  font-size: 15px;
  overflow-wrap: anywhere;
}
.model-card p {
  margin: 12px 0 20px;
  color: #94a298;
  font-size: 11px;
}
.settings-list {
  margin: 0;
  padding: 0 24px 10px;
}
.settings-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.settings-row dt {
  color: #88978e;
}
.settings-row dd {
  margin: 0;
  color: #425f4b;
  overflow-wrap: anywhere;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #526b5a;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #dce5df;
  background: white;
  border-radius: 7px;
  padding: 10px 12px;
  color: #304d3b;
  min-height: 40px;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #8ac4a6;
  outline-offset: 1px;
}
label input {
  margin-top: 8px;
}
label small {
  display: block;
  font-size: 10px;
  color: #92a296;
  line-height: 1.6;
  margin-top: 6px;
  font-weight: 400;
}
dialog {
  border: 1px solid #dae5de;
  border-radius: 15px;
  max-width: 580px;
  width: calc(100% - 32px);
  padding: 28px;
  color: var(--ink);
  box-shadow: 0 20px 100px #142c2a35;
  max-height: calc(100dvh - 40px);
  overflow: auto;
}
dialog::backdrop {
  background: #102c2680;
  backdrop-filter: blur(3px);
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}
.dialog-heading h2 {
  font-size: 21px;
  margin-top: 5px;
}
dialog > .muted,
#policy-form > .muted {
  font-size: 12px;
  line-height: 1.8;
  margin-bottom: 24px;
}
dialog > p {
  line-height: 1.8;
  margin-bottom: 14px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.full {
  grid-column: 1/-1;
}
fieldset {
  margin: 0;
  border: 1px solid #e1e9e3;
  border-radius: 8px;
  padding: 12px;
}
legend {
  font-size: 12px;
  color: #526b5a;
  padding: 0 4px;
}
.model-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.model-options label {
  display: flex;
  gap: 7px;
  align-items: center;
  font: 11px var(--mono);
  overflow-wrap: anywhere;
}
.model-options input {
  width: 15px;
  min-height: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--green);
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
#issued-key {
  margin-top: 9px;
  font: 12px/1.7 var(--mono);
  resize: none;
  background: #f3f8f5;
  overflow-wrap: anywhere;
}
.login-view {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 50px 24px;
  background:
    radial-gradient(ellipse at 65% 0%, #dfeee5 0, transparent 55%), #f4f8f5;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 650;
  margin-bottom: 32px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  padding: 34px;
  background: #fff;
  border: 1px solid #e1eae3;
  border-radius: 15px;
  box-shadow: 0 15px 45px #164b2c06;
}
.login-card h1 {
  font-size: 24px;
  margin: 10px 0;
}
.login-card > .muted {
  font-size: 12px;
  margin-bottom: 27px;
}
.login-card > input {
  margin-top: 9px;
}
.login-note {
  font-size: 10px;
  color: #97a69b;
  line-height: 1.9;
  margin-top: 20px;
}
.login-foot {
  font-size: 10px;
  color: #9dad9f;
  margin-top: 30px;
  letter-spacing: 1px;
}
@media (min-width: 1450px) {
  .content {
    padding-top: 42px;
  }
  .overview-grid {
    grid-template-columns: minmax(0, 1fr) 335px;
  }
}
@media (max-width: 1150px) {
  .app {
    grid-template-columns: 196px minmax(0, 1fr);
  }
  .content {
    padding: 28px;
  }
  .topbar {
    padding: 0 28px;
  }
  .overview-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .overview-aside {
    grid-template-columns: 1fr 1fr;
  }
  .updated {
    display: none;
  }
  .metrics {
    gap: 12px;
  }
  .metric {
    padding: 18px 16px;
  }
  .metric small {
    font-size: 9px;
  }
}
@media (max-width: 760px) {
  .app {
    display: block;
  }
  .sidebar {
    position: relative;
    height: auto;
    padding: 18px 20px 12px;
  }
  .brand {
    font-size: 17px;
  }
  .brand small,
  .nav-label,
  .sidebar-version,
  .connection {
    display: none;
  }
  .sidebar nav {
    display: flex;
    gap: 3px;
    margin-top: 19px;
  }
  .nav-item {
    font-size: 11px;
    padding: 10px 9px;
    justify-content: center;
    gap: 7px;
    margin: 0;
  }
  .nav-item span {
    font-size: 18px;
    width: auto;
  }
  .nav-item.active {
    box-shadow: none;
  }
  .sidebar-bottom {
    position: absolute;
    right: 23px;
    top: 28px;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .logout {
    font-size: 10px;
  }
  .topbar {
    height: 55px;
    padding: 0 20px;
  }
  .content {
    padding: 24px 18px;
  }
  .page-heading {
    display: block;
    margin-bottom: 23px;
  }
  .page-heading h1 {
    font-size: 25px;
  }
  .heading-actions {
    margin-top: 17px;
    justify-content: flex-end;
  }
  .heading-actions .button {
    font-size: 11px;
    min-height: 36px;
    padding: 8px 12px;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
  }
  .metric strong {
    font-size: 28px;
  }
  .metric small {
    font-size: 9px;
  }
  .overview-aside {
    grid-template-columns: 1fr;
  }
  .overview-grid {
    gap: 18px;
  }
  .panel-heading {
    padding: 20px 18px;
  }
  th,
  td {
    padding: 13px 15px;
  }
  #recent-body .mono {
    max-width: 130px;
    overflow-wrap: anywhere;
  }
  .panel-foot {
    padding: 14px 18px;
  }
  .footer {
    margin-top: 30px;
    flex-direction: column;
    font-size: 9px;
  }
  .key-toolbar {
    padding: 16px;
    flex-wrap: wrap;
  }
  .key-toolbar select {
    width: 110px;
  }
  .key-toolbar > .muted {
    width: 100%;
    margin-left: 0;
    font-size: 10px;
  }
  .search-box {
    max-width: none;
  }
  .model-grid {
    grid-template-columns: 1fr;
  }
  .settings-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .form-grid {
    gap: 15px;
  }
  .dialog-heading h2 {
    font-size: 19px;
  }
  dialog {
    padding: 22px;
  }
  .login-card {
    padding: 27px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button {
    transition:
      background 0.15s,
      color 0.15s;
  }
  .page {
    animation: appear 0.2s ease-out;
  }
  @keyframes appear {
    from {
      opacity: 0.5;
      transform: translateY(3px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}
