:root {
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  color: #182039;
  background: #f3f5fa;
  font-synthesis: none;
  --accent: #433bd0;
  --accent-hover: #362db4;
  --line: #e4e8f2;
  --muted: #59647d;
  --shadow: 0 10px 30px rgba(30, 34, 71, .07);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
h1, h2, p { margin: 0; }
button, input, textarea, select { font: inherit; }
button, a, input, select, textarea { outline-offset: 3px; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
a { color: var(--accent); }
input, textarea, select { width: 100%; border: 1px solid #d4dbeb; border-radius: 9px; padding: 10px 12px; color: inherit; background: white; min-width: 0; }
textarea { resize: vertical; }
.upload-list { display: grid; gap: 8px; margin-top: 9px; }
.upload-item { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fafbff; }
.upload-item > div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.upload-status { color: var(--muted); text-align: right; }
.upload-item progress { width: 100%; height: 7px; margin-top: 8px; accent-color: var(--accent); }
.upload-error { border-color: #e6a9ba; background: #fff5f7; }
.transfer-links { display: grid; gap: 6px; margin: 7px 0 14px; }
.transfer-links span, .transfer-links a { overflow-wrap: anywhere; }
label { display: block; font-size: 13px; font-weight: 650; color: #36415d; margin-bottom: 6px; }
.primary, .secondary, .danger { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 15px; border-radius: 9px; white-space: nowrap; text-decoration: none; font-size: 14px; font-weight: 650; }
.primary { color: white; background: var(--accent); border: 1px solid var(--accent); box-shadow: 0 4px 11px #433bd029; }
.primary:hover { background: var(--accent-hover); }
.secondary { color: #35405d; background: white; border: 1px solid #d9dfed; }
.secondary:hover { background: #f5f6fa; }
.danger { color: #a72445; border: 1px solid #f4cbda; background: #fff4f7; }
.danger:hover { background: #ffe6ee; }
.entry { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at top left, #d7d9f9, transparent 52%), #f2f4fa; }
.login-card { width: min(100%, 414px); background: white; padding: 38px; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.login-card h1 { margin-top: 19px; font-size: 28px; letter-spacing: -.8px; }
.login-card > p { color: var(--muted); margin: 6px 0 26px; }
.login-card .primary { width: 100%; margin-top: 16px; }
.brand-icon { width: 38px; height: 38px; flex: 0 0 38px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding-bottom: 10px; border-radius: 11px; color: white; background: #645cf4; border: 1px solid #ffffff35; }
.brand-icon i { width: 4px; height: 9px; border-radius: 2px; background: currentColor; }
.brand-icon i:nth-child(2) { height: 13px; }
.brand-icon i:nth-child(3) { height: 17px; }
.layout { display: grid; grid-template-columns: 225px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { display: flex; flex-direction: column; gap: 35px; padding: 27px 17px; color: #c9cdec; background: #171c34; position: sticky; top: 0; height: 100dvh; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 7px; }
.brand strong { display: block; color: #fff; font-size: 16px; letter-spacing: -.2px; }
.brand div span { display: block; margin-top: 3px; color: #a8afd1; font-size: 12px; }
.nav { display: grid; gap: 7px; }
.nav button, .sign-out { text-align: left; color: #c9cdec; background: transparent; border: 1px solid transparent; border-radius: 9px; padding: 11px 12px; }
.nav button { display: flex; align-items: center; gap: 10px; }
.nav button:hover, .sign-out:hover { background: #262b4a; }
.nav button[aria-current="page"] { background: #30345d; border-color: #414778; color: white; }
.nav button span { color: #b2aaff; }
.sidebar-bottom { margin-top: auto; padding: 9px 5px 0; border-top: 1px solid #333958; font-size: 13px; }
#connection-status { display: flex; align-items: center; gap: 8px; padding: 10px 7px 6px; }
.signal { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #ffbd6c; }
.connected .signal { background: #59dfac; }
.sign-out { width: 100%; padding-left: 7px; }
.workspace { width: 100%; min-width: 0; max-width: 1540px; padding: clamp(20px, 4vw, 54px); }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 25px; }
.page-heading h1 { font-size: clamp(26px, 3vw, 36px); line-height: 1.2; letter-spacing: -1px; }
.page-heading p { margin-top: 8px; color: var(--muted); font-size: 14px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.metric { display: grid; gap: 12px; text-align: left; padding: 17px 19px; border: 1px solid var(--line); border-radius: 13px; background: white; color: #253154; }
.metric:hover, .metric[aria-pressed="true"] { border-color: #827bf0; }
.metric .metric-label { font-size: 13px; color: var(--muted); }
.metric strong { font-size: 27px; font-weight: 650; font-variant-numeric: tabular-nums; }
.panel { border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 17px; }
.panel-head p { color: var(--muted); font-size: 12px; margin-top: 5px; }
.filters { display: flex; gap: 8px; }
.filters input, .filters select { font-size: 13px; padding: 8px 9px; }
.filters input { max-width: 175px; }
.filters select { width: auto; }
.table-wrap { position: relative; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th { color: var(--muted); background: #f8f9fd; white-space: nowrap; font-weight: 600; }
td, th { padding: 13px 16px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
td { min-width: 115px; }
td:first-child { width: 34%; }
td:last-child { min-width: 70px; width: 1%; text-align: right; }
td strong { display: block; overflow-wrap: anywhere; }
.table-note { color: var(--muted); display: block; font-size: 12px; margin-top: 4px; }
.text-button { border: 0; background: transparent; padding: 4px; color: var(--accent); white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; color: #4c5771; background: #eef1f7; padding: 4px 8px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill[data-state="running"], .pill[data-state="leased"] { color: #3c36ae; background: #efedff; }
.pill[data-state="succeeded"], .pill[data-state="online"] { color: #146843; background: #e6f7ed; }
.pill[data-state="needs_review"], .pill[data-state="invited"] { color: #815010; background: #fff1d9; }
.pill[data-state="failed"], .pill[data-state="revoked"] { color: #a52847; background: #ffeaf0; }
.empty { min-height: 215px; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 25px; text-align: center; }
.empty-icon { display: grid; place-items: center; color: #4d46cc; background: #efedff; width: 44px; height: 44px; border-radius: 13px; font-size: 22px; margin-bottom: 4px; }
.empty p { color: var(--muted); font-size: 13px; }
dialog { width: min(560px, calc(100% - 28px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 22px 80px #10152c4d; color: inherit; }
dialog::backdrop { background: #16193680; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 19px; }
.icon-button { border: none; background: #eef0f7; color: #414e6b; font-size: 20px; width: 33px; height: 33px; border-radius: 8px; }
.dialog-body { display: grid; padding: 20px; gap: 10px; }
.dialog-body p { line-height: 1.6; color: var(--muted); overflow-wrap: anywhere; }
.dialog-body label { margin: 0; }
.form-row, .copy-row { display: flex; gap: 9px; }
.form-row > div { flex: 1 1 0; min-width: 0; }
.form-row label, #retry-target-field label { margin-bottom: 7px; }
.hint { font-size: 12px; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 7px; }
.error, .dialog-body .error { color: #a72445; font-size: 13px; }
.steps { padding-left: 20px; margin: 3px 0; color: var(--muted); line-height: 1.65; }
.detail-block { white-space: pre-wrap; overflow-wrap: anywhere; background: #f6f7fc; border-radius: 9px; padding: 11px; margin: 0; font: inherit; font-size: 13px; max-height: 225px; overflow: auto; }
.event-log { display: grid; gap: 7px; padding: 0; margin: 0; list-style: none; color: var(--muted); font-size: 12px; }
.event-log li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toast { position: fixed; bottom: 17px; right: 17px; max-width: calc(100% - 34px); padding: 13px 16px; border-radius: 10px; background: #202547; color: white; box-shadow: var(--shadow); z-index: 10; }
.visually-hidden { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; gap: 12px; padding: 12px 15px; display: grid; grid-template-columns: 1fr auto; }
  .nav { grid-column: 1 / -1; grid-row: 2; grid-template-columns: 1fr 1fr; }
  .nav button { padding: 8px 10px; }
  .sidebar-bottom { border: none; padding: 0; }
  #connection-status { padding: 0 2px 4px; }
  .sign-out { padding: 2px; }
  td, th { padding: 11px 12px; }
}
@media (max-width: 460px) {
  .workspace { padding: 17px 12px; }
  .page-heading { align-items: flex-start; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric { padding: 12px; }
  .panel-head { flex-wrap: wrap; }
  .filters { width: 100%; }
  .filters input { max-width: none; }
  .login-card { padding: 26px; }
}
