:root {
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #202b3c;
  background: #f5f7fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --blue: #1664ff;
  --blue-dark: #0c4bd2;
  --muted: #78859a;
  --border: #e7ebf2;
  --green: #17a673;
  --shadow: 0 8px 28px rgba(27, 46, 84, .06);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.login-layout { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 30%, #eaf1ff, #f7f9fc 58%); }
.login-card { width: min(100%, 410px); padding: 42px; border: 1px solid #edf0f5; border-radius: 20px; background: #fff; box-shadow: 0 20px 70px rgba(32, 54, 94, .11); }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: #fff; background: linear-gradient(145deg, #4587ff, #1458e7); font-size: 19px; font-weight: 700; box-shadow: 0 6px 15px #1664ff35; }
.eyebrow { margin: 25px 0 7px; color: #8d99ad; font-size: 10px; font-weight: 700; letter-spacing: 1.6px; }
h1, h2, p { margin-top: 0; }
.login-card h1, .page-heading h1 { margin: 0 0 9px; color: #1c2a3d; font-size: 27px; letter-spacing: -.5px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.7; }
.login-card form { display: grid; gap: 10px; margin-top: 27px; }
label, legend { color: #344256; font-size: 13px; font-weight: 600; }
input, select, textarea { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid #dfe5ee; border-radius: 8px; outline: none; color: #253348; background: #fff; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: #6b9cff; box-shadow: 0 0 0 3px #1664ff15; }
input::placeholder, textarea::placeholder { color: #a4afbf; }
textarea { resize: vertical; }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 0 18px; border: 0; border-radius: 8px; font-size: 13px; font-weight: 650; transition: background .15s, transform .15s; }
.button:disabled { cursor: wait; opacity: .7; }
.button-primary { color: white; background: var(--blue); box-shadow: 0 4px 11px #1664ff30; }
.button-primary:hover:not(:disabled) { background: var(--blue-dark); transform: translateY(-1px); }
.button-secondary { border: 1px solid #e8dada; color: #a64b4b; background: #fff; }
.button-secondary:hover:not(:disabled) { background: #fff5f4; }
.full-width { width: 100%; margin-top: 8px; }
.login-footnote { display: flex; align-items: center; gap: 9px; margin: 28px 0 0; color: #748198; font-size: 11px; }
.form-error { min-height: 18px; margin: 0; color: #d94b4b; font-size: 12px; }
.status-dot, .api-badge-dot { display: inline-block; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px #17a67319; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 3; width: 246px; display: flex; flex-direction: column; padding: 23px 15px 15px; border-right: 1px solid var(--border); background: #fff; }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 35px; }
.sidebar-brand strong { display: block; font-size: 13px; }
.sidebar-brand small { display: block; margin-top: 4px; color: #9aa5b7; font-size: 8px; letter-spacing: 1px; }
.nav-caption { padding: 0 11px 10px; color: #9aa5b7; font-size: 11px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 8px; color: #526178; font-size: 13px; text-decoration: none; }
.nav-item.active { color: #155be4; background: #edf4ff; font-weight: 650; }
.nav-icon { font-size: 19px; line-height: 1; }
.nav-chevron { margin-left: auto; font-size: 20px; }
.sidebar-bottom { margin-top: auto; }
.secure-note { display: flex; align-items: flex-start; gap: 10px; margin: 0 4px 16px; padding: 12px 10px; border: 1px solid #e8f4ee; border-radius: 9px; color: #415b50; font-size: 11px; line-height: 1.6; }
.secure-note .status-dot { margin: 5px 0 0 2px; }
.secure-note small { color: #81958c; font-size: 10px; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 14px 5px 0; border-top: 1px solid var(--border); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #315eb7; background: #eaf1ff; font-size: 13px; font-weight: 700; }
.user-name { flex: 1; color: #35435a; font-size: 12px; font-weight: 650; }
.user-name small { display: block; margin-top: 4px; color: #98a3b4; font-size: 10px; font-weight: 400; }
.icon-button { width: 31px; height: 31px; border: 0; border-radius: 7px; color: #75839a; background: transparent; font-size: 18px; }
.icon-button:hover { color: #d24b4b; background: #fff1f1; }
.main-content { max-width: 1270px; margin-left: 246px; padding: 0 42px 28px; }
.topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.breadcrumbs { color: #8591a5; font-size: 12px; }
.breadcrumbs span { margin: 0 9px; color: #c1c9d4; }
.breadcrumbs strong { color: #344256; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 8px; color: #728097; font-size: 11px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 28px 0 19px; }
.page-heading .eyebrow { margin: 0 0 8px; }
.page-heading h1 { font-size: 25px; }
.page-heading .muted { margin: 0; }
.required-mark { color: #e25959; }
.api-badge { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid #e4e9f1; border-radius: 20px; color: #637189; background: white; font-size: 10px; white-space: nowrap; }
.api-badge-dot { width: 6px; height: 6px; }
.notice { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 15px; padding: 14px 16px; border: 1px solid #dceaff; border-radius: 10px; background: #f1f7ff; color: #3a526e; }
.notice-icon { width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #fff; background: #4a8afa; font-size: 12px; font-weight: 700; }
.notice strong { display: block; margin: 1px 0 4px; font-size: 12px; }
.notice p { margin: 0; color: #647a95; font-size: 11px; line-height: 1.65; }
.notice-success { border-color: #d9eee4; background: #f1faf5; }
.notice-success .notice-icon { background: #1aa474; }
.notice-error { border-color: #f1dada; background: #fff5f4; }
.notice-error .notice-icon { background: #d65b57; }
.form-card { margin-bottom: 14px; padding: 20px 22px 22px; border: 1px solid var(--border); border-radius: 11px; background: #fff; box-shadow: var(--shadow); }
.card-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.step-number { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; color: #2764d4; background: #eef4ff; font-size: 11px; font-weight: 700; }
.card-heading h2 { margin: 0 0 4px; color: #25344a; font-size: 14px; }
.card-heading p { margin: 0; color: #8793a7; font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; }
.field { min-width: 0; display: grid; align-content: start; gap: 7px; }
.field label, .field legend { font-size: 12px; }
.field small { color: #8d99ab; font-size: 10px; line-height: 1.5; }
.full-span { grid-column: 1 / -1; }
fieldset.field { margin: 0; padding: 0; border: 0; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid #e4e8ef; border-radius: 7px; color: #5f6e82; background: #fff; font-size: 11px !important; font-weight: 500 !important; cursor: pointer; }
.choice:has(input:checked) { border-color: #8db4ff; color: #245fc9; background: #f4f8ff; }
.choice input { width: 13px; min-height: 13px; height: 13px; margin: 0; accent-color: var(--blue); }
.input-suffix { display: flex; align-items: center; }
.input-suffix input { border-radius: 8px 0 0 8px; }
.input-suffix span { min-height: 42px; display: grid; place-items: center; padding: 0 12px; border: 1px solid #dfe5ee; border-left: 0; border-radius: 0 8px 8px 0; color: #8290a4; background: #f8f9fb; font-size: 11px; }
.summary-box { display: grid; gap: 5px; padding: 13px 15px; border: 1px solid #e4ecfa; border-radius: 8px; background: #f7faff; color: #65758d; font-size: 11px; }
.summary-box strong { color: #245fc9; font-size: 18px; }
.summary-box small { color: #8b97a9; font-size: 10px; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 7px 2px; }
.form-actions .muted { margin: 0; font-size: 11px; }
.form-actions-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.page-view { min-width: 0; }
.credential-list { display: grid; gap: 10px; }
.authorization-qr-result { display: flex; align-items: center; gap: 20px; padding: 18px; border: 1px solid #e4eaf3; border-radius: 9px; background: #f9fbff; }
.authorization-qr-result img { width: 180px; height: 180px; border: 8px solid #fff; box-shadow: 0 2px 12px #24324718; image-rendering: pixelated; }
.authorization-qr-result strong { display: block; margin-bottom: 7px; color: #25344a; font-size: 13px; }
.authorization-qr-result p { margin: 0 0 9px; }
.authorization-qr-result a { color: #1664ff; font-size: 12px; }
.credential-row { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--border); border-radius: 9px; background: #fff; }
.credential-details { min-width: 0; flex: 1; }
.credential-details strong { display: block; margin-bottom: 5px; font-size: 13px; }
.credential-details span, .credential-details small { display: block; overflow-wrap: anywhere; color: var(--muted); font-size: 11px; line-height: 1.6; }
.credential-delete { min-height: 34px; padding: 0 12px; border: 1px solid #f0d7d7; border-radius: 7px; color: #b94b4b; background: #fff; font-size: 11px; }
.credential-delete:hover { background: #fff5f4; }
.empty-state { padding: 20px; color: var(--muted); text-align: center; font-size: 12px; }
.page-footer { padding: 20px 0 0; color: #9ba6b7; font-size: 10px; text-align: center; }
.page-footer span { margin: 0 5px; }

@media (max-width: 900px) {
  .sidebar { width: 205px; }
  .main-content { margin-left: 205px; padding: 0 24px 24px; }
}
@media (max-width: 660px) {
  .sidebar { position: static; width: 100%; height: auto; padding: 12px 15px; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar-brand { padding: 0; }
  .sidebar-brand .brand-mark { width: 35px; height: 35px; }
  .nav-caption, .sidebar-bottom { display: none; }
  .sidebar nav { margin-top: 13px; }
  .nav-item { padding: 8px 10px; }
  .main-content { margin-left: 0; padding: 0 15px 20px; }
  .topbar { height: 49px; }
  .topbar-right { font-size: 0; }
  .page-heading { align-items: flex-start; flex-direction: column; padding: 22px 0 15px; }
  .form-grid { grid-template-columns: 1fr; gap: 15px; }
  .form-grid.full-span { grid-column: auto; }
  .full-span { grid-column: auto; }
  .form-card { padding: 17px 15px; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions-buttons { display: grid; }
  .form-actions .button { width: 100%; }
  .authorization-qr-result { align-items: center; flex-direction: column; text-align: center; }
}
