:root {
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  color: #202635;
  background: #f6f7fb;
  font-synthesis: none;
  --accent: #6450db;
  --muted: #7c8495;
  --border: #e9ebf2;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button,
input,
select,
textarea {
  border-radius: 9px;
}
input,
select,
textarea {
  border: 1px solid #dfe3ed;
  background: #fff;
  color: inherit;
  padding: 11px 12px;
  max-width: 100%;
  min-width: 0;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #b3a5fa;
  border-color: transparent;
}
label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 550;
}
button {
  border: 0;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 550;
  transition: background 0.15s;
}
button.primary {
  background: var(--accent);
  color: white;
}
button.primary:hover {
  background: #5341c2;
}
.secondary {
  background: #fff;
  border: 1px solid #dfe3ed;
}
.secondary:hover {
  background: #f7f6ff;
}
.quiet {
  background: transparent;
  color: #646d80;
}
.quiet:hover {
  background: #eceef6;
}
.danger {
  color: #bd3e48;
}
.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.fine {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
}
.eyebrow {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 650;
  margin: 0 0 10px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 27px;
  letter-spacing: -0.7px;
  margin-bottom: 8px;
}
h2 {
  font-size: 17px;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}
h3 {
  font-size: 14px;
  margin-bottom: 5px;
}
.tag {
  display: inline-flex;
  color: var(--accent);
  background: #eeeaff;
  font-size: 10px;
  letter-spacing: 1px;
  border-radius: 5px;
  padding: 6px 8px;
  font-weight: 600;
}
.inline {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
:root [hidden] {
  display: none;
}
.shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 238px;
  background: #171c30;
  color: #d4d7e4;
  padding: 31px 19px 22px;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  color: white;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  padding: 0 8px 25px;
}
.brand small {
  display: block;
  color: #8c94b0;
  font-size: 10px;
  font-weight: 400;
  margin-top: 5px;
  letter-spacing: 2px;
}
.brand-icon {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #9b8af8, #6051cf);
  color: #fff;
  border-radius: 12px;
  width: 36px;
  height: 36px;
  font-size: 23px;
  font-weight: 650;
  flex-shrink: 0;
}
.nav-label {
  font-size: 10px;
  color: #747d9a;
  letter-spacing: 1px;
  padding: 24px 15px 12px;
}
.nav-item {
  display: flex;
  align-items: center;
  text-align: left;
  width: 100%;
  padding: 13px 15px;
  color: #a8b0c7;
  background: transparent;
  gap: 12px;
  margin: 4px 0;
  font-size: 13px;
}
.nav-item > span {
  font-size: 19px;
  font-weight: 400;
  width: 22px;
}
.nav-item:hover {
  background: #232a43;
  color: #fff;
}
.nav-item.active {
  background: #34304f;
  color: #d8d0ff;
}
.sidebar-bottom {
  margin-top: auto;
  font-size: 12px;
  padding: 18px 10px 0;
  border-top: 1px solid #2a3046;
  color: #ccd0e0;
}
.sidebar-bottom small {
  display: block;
  font-size: 10px;
  color: #747d9a;
  margin-top: 10px;
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6bc5a0;
  display: inline-block;
  margin-right: 8px;
}
main {
  margin-left: 238px;
  width: calc(100% - 238px);
}
.topbar {
  height: 72px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}
.breadcrumb {
  color: #969dad;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-badge {
  color: #646d80;
  font-size: 11px;
  border-right: 1px solid var(--border);
  padding-right: 17px;
  margin-right: 6px;
}
.content {
  padding: 34px 36px 20px;
  max-width: 1560px;
  margin: auto;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
}
.page-heading p {
  margin-bottom: 0;
}
.page-heading .eyebrow {
  margin-bottom: 10px;
}
.date-badge {
  border: 1px solid var(--border);
  background: #fff;
  padding: 10px 13px;
  border-radius: 8px;
  font-size: 11px;
  color: var(--muted);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 17px;
  margin-bottom: 25px;
}
.metric {
  background: #fff;
  padding: 21px;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 3px 12px #19234803;
}
.metric-label {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}
.metric-icon {
  color: #9b8deb;
}
.metric strong {
  display: block;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -1px;
  margin: 14px 0 8px;
}
.metric small {
  font-size: 10px;
  color: #9aa1b1;
}
.panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 22px;
  overflow: hidden;
}
.panel-heading {
  padding: 23px 24px 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.panel-heading p {
  margin-bottom: 0;
}
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 285px;
  gap: 22px;
}
.accent-panel {
  background: linear-gradient(145deg, #eeebff, #faf9ff);
  border-color: #e2dcfb;
  padding: 25px;
}
.accent-panel h2 {
  margin-top: 19px;
}
.accent-panel button {
  width: 100%;
}
.steps {
  padding-left: 22px;
  margin: 24px 0 27px;
}
.steps li {
  padding: 0 0 21px 5px;
  font-size: 12px;
  color: #75669e;
}
.steps b {
  display: block;
  color: #41405b;
  font-size: 13px;
  margin-bottom: 6px;
}
.steps span {
  color: #8b86a1;
  font-size: 11px;
}
.accent-panel .fine {
  font-size: 10px;
  margin-top: 15px;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  text-align: left;
}
th {
  background: #fafbfe;
  color: #9299a9;
  font-size: 10px;
  letter-spacing: 0.5px;
  font-weight: 500;
  padding: 13px 22px;
  white-space: nowrap;
  border-top: 1px solid #f0f1f6;
  border-bottom: 1px solid #f0f1f6;
}
td {
  padding: 18px 22px;
  border-bottom: 1px solid #f0f1f6;
  vertical-align: middle;
  line-height: 1.65;
}
tbody tr:last-child td {
  border-bottom: 0;
}
.table-wrap td strong {
  font-size: 12px;
  font-weight: 550;
}
.table-wrap td small {
  display: block;
  color: #9aa1b1;
  font-size: 10px;
  margin-top: 3px;
}
td .quiet {
  padding: 5px 9px;
  color: var(--accent);
  font-size: 11px;
}
.pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 5px;
  background: #edf8f2;
  color: #408767;
  font-size: 10px;
  white-space: nowrap;
}
.pill.warning {
  background: #fff5e8;
  color: #b68640;
}
.pill.muted {
  background: #f0f1f5;
  color: #8b93a5;
}
.pill.bad {
  background: #fff0f1;
  color: #c2636a;
}
.empty {
  text-align: center;
  color: #969dad;
  padding: 45px 22px;
  font-size: 12px;
}
.usage-value {
  font-variant-numeric: tabular-nums;
}
.usage-track {
  height: 4px;
  width: 100%;
  min-width: 70px;
  background: #eeeef7;
  border-radius: 5px;
  margin-top: 8px;
  overflow: hidden;
}
.usage-fill {
  height: 100%;
  background: #a998ee;
  border-radius: 5px;
}
.subscription-form {
  display: flex;
  align-items: flex-end;
  gap: 15px;
  padding: 0 24px 25px;
  flex-wrap: wrap;
}
.subscription-form label {
  min-width: 180px;
}
.subheading {
  border-top: 1px solid var(--border);
}
.form-panel {
  padding: 24px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 25px 0;
}
.workspace-panel {
  padding: 0 24px 24px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.workspace-panel .panel-heading {
  padding: 24px 0 16px;
  border: 0;
}
.workspace-panel input[readonly] {
  background: #f6f7fb;
  color: var(--muted);
}
.workspace-panel .inline {
  margin-top: 16px;
}
.session-grid {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 390px;
  border-top: 1px solid var(--border);
}
.thread-list {
  border-right: 1px solid var(--border);
  max-height: 620px;
  overflow: auto;
  padding: 10px;
}
.thread {
  display: block;
  text-align: left;
  width: 100%;
  padding: 15px;
  background: transparent;
  border: 1px solid transparent;
  margin-bottom: 6px;
}
.thread strong {
  font-size: 11px;
  display: block;
  overflow-wrap: anywhere;
}
.thread small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 8px;
}
.thread:hover,
.thread.active {
  background: #f6f3ff;
  border-color: #e4ddfa;
}
.messages {
  padding: 24px;
  max-height: 620px;
  overflow: auto;
}
.message {
  padding: 16px;
  background: #f8f9fc;
  border: 1px solid #eef0f5;
  border-radius: 9px;
  margin-bottom: 16px;
}
.message.assistant {
  background: #f6f3ff;
  border-color: #eae3ff;
}
.message p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 9px 0 0;
  font-size: 13px;
  line-height: 1.85;
}
.message small {
  font-size: 10px;
  color: #9097a8;
}
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  padding: 0 24px 24px;
}
.service-card {
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: 9px;
}
.service-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}
.service-card p {
  font-size: 11px;
  color: var(--muted);
  margin: 14px 0 0;
}
.banner {
  background: #f4f1ff;
  border: 1px solid #e4ddfb;
  color: #786aab;
  border-radius: 8px;
  padding: 13px 16px;
  font-size: 12px;
  line-height: 1.7;
  margin: 0 24px 18px;
}
.error {
  color: #bc4754;
}
.banner.error {
  background: #fff1f2;
  border-color: #f5dce1;
  margin: 0 0 22px;
}
footer {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #a0a6b5;
  padding: 15px 0 5px;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 8%;
  padding: 8% 12%;
  background:
    radial-gradient(ellipse at 15% 30%, #e8e3fc, transparent 60%), #f6f7fb;
}
.login-intro .brand-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 28px;
  font-size: 30px;
}
.login-intro h1 {
  font-size: 38px;
  line-height: 1.5;
  margin: 18px 0;
}
.login-intro > p:not(.eyebrow) {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}
.intro-foot {
  display: block;
  font-size: 11px;
  color: #9692ad;
  margin-top: 70px;
  letter-spacing: 2px;
}
.login-card {
  padding: 40px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 17px;
  box-shadow: 0 20px 80px #22203b08;
  max-width: 430px;
}
.login-card h2 {
  font-size: 25px;
  margin-top: 25px;
}
.login-card label {
  margin-top: 30px;
  margin-bottom: 9px;
}
.login-card input,
.login-card button {
  width: 100%;
}
.login-card button {
  display: flex;
  justify-content: space-between;
  margin-bottom: 25px;
  padding: 13px 15px;
}
.login-card .error {
  font-size: 12px;
  min-height: 18px;
  margin: 10px 0 15px;
}
.login-card .fine {
  font-size: 10px;
  margin-bottom: 0;
}
dialog {
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 28px;
  width: min(500px, calc(100% - 32px));
  color: inherit;
  box-shadow: 0 25px 100px #11162f30;
}
dialog::backdrop {
  background: #10152870;
  backdrop-filter: blur(3px);
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.icon-button {
  font-size: 23px;
  background: transparent;
  color: #9299a9;
  padding: 0 5px;
}
dialog label {
  margin-top: 21px;
}
dialog .primary {
  margin-top: 25px;
  width: 100%;
}
dialog .banner {
  margin: 15px 0;
}
dialog textarea {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  resize: none;
  word-break: break-all;
}
#toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  padding: 15px 22px;
  border: 1px solid #ddd7f9;
  background: #fff;
  color: #5c4d9b;
  border-radius: 10px;
  box-shadow: 0 6px 35px #24243a15;
  font-size: 13px;
  max-width: min(440px, 90vw);
  z-index: 10;
}
@media (min-width: 1500px) {
  .content {
    padding-top: 44px;
  }
  .metrics {
    gap: 24px;
  }
  .metric {
    padding: 26px;
  }
  .overview-grid {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}
@media (max-width: 1150px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .accent-panel {
    display: none;
  }
  .content {
    padding: 25px;
  }
  .topbar {
    padding: 0 25px;
  }
  .metric {
    padding: 16px;
  }
  .metric strong {
    font-size: 26px;
  }
  .service-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .login-shell {
    padding: 8%;
  }
}
@media (max-width: 800px) {
  .sidebar {
    position: static;
    width: 100%;
    padding: 18px;
  }
  .brand {
    padding-bottom: 5px;
  }
  .sidebar > .nav-label,
  .sidebar-bottom,
  .sidebar nav .nav-label {
    display: none;
  }
  .sidebar nav {
    display: flex;
    overflow-x: auto;
    gap: 6px;
    margin-top: 10px;
  }
  .nav-item {
    white-space: nowrap;
    width: auto;
    padding: 10px;
  }
  .nav-item > span {
    display: none;
  }
  .shell {
    display: block;
  }
  main {
    width: 100%;
    margin: 0;
  }
  .topbar {
    height: 60px;
    padding: 0 18px;
  }
  .admin-badge {
    display: none;
  }
  .content {
    padding: 25px 18px;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .page-heading h1 {
    font-size: 23px;
  }
  .date-badge {
    display: none;
  }
  .panel-heading {
    padding: 20px;
    flex-wrap: wrap;
  }
  .session-grid {
    grid-template-columns: 1fr;
  }
  .thread-list {
    max-height: 200px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .login-shell {
    grid-template-columns: 1fr;
    padding: 25px;
    gap: 25px;
  }
  .login-intro h1,
  .login-intro > p:not(.eyebrow),
  .intro-foot {
    display: none;
  }
  .login-intro .brand-icon {
    display: inline-grid;
    margin: 0 10px 0 0;
    vertical-align: middle;
  }
  .login-intro .eyebrow {
    display: inline-block;
  }
  .login-card {
    max-width: 480px;
    width: 100%;
    justify-self: center;
  }
  .service-grid {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .page-heading {
    align-items: flex-start;
  }
  th,
  td {
    padding-left: 18px;
    padding-right: 18px;
  }
}
