:root {
  --bg: #f1f5fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef3f9;
  --ink: #0f1d2e;
  --ink-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e3eaf2;
  --line-strong: #cbd5e1;
  --brand: #1d4ed8;
  --brand-2: #2563eb;
  --brand-soft: #e8efff;
  --cyan: #0e7490;
  --cyan-soft: #e0f2fe;
  --green: #15803d;
  --green-soft: #e7f6ec;
  --amber: #b45309;
  --amber-soft: #fff7e6;
  --red: #b91c1c;
  --red-soft: #fee9e9;
  --sidebar: #0c1a29;
  --sidebar-2: #122539;
  --sidebar-ink: #c7d5e5;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 14px 32px -24px rgba(15, 23, 42, .35);
  --shadow-lg: 0 24px 70px -24px rgba(6, 17, 35, .45);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.modal-open { overflow: hidden; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
svg { display: block; flex: none; }
::selection { background: #bfdbfe; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.text-danger { color: var(--red); }
.text-success { color: var(--green); }
.nowrap { white-space: nowrap; }

:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }

/* ---------- boot ---------- */
.boot {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  background: radial-gradient(1200px 600px at 50% -10%, #dbeafe, transparent 60%), var(--bg);
}
.boot-mark { animation: bootPulse 1.6s ease-in-out infinite; }
.boot-text { color: var(--muted); font-size: 14px; letter-spacing: .04em; }
@keyframes bootPulse { 0%, 100% { transform: translateY(0); opacity: .85; } 50% { transform: translateY(-6px); opacity: 1; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 7px 14px;
  border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--surface); color: var(--ink-2);
  font-size: 13.5px; font-weight: 600; line-height: 1;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: #b6c2d2; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 8px 16px -10px rgba(29, 78, 216, .8); }
.btn-primary:hover { background: #1741bd; border-color: #1741bd; }
.btn-secondary { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.btn-secondary:hover { background: #dbe7ff; border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--ink-2); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #a51a1a; border-color: #a51a1a; }
.btn-danger-soft { background: var(--red-soft); border-color: transparent; color: var(--red); }
.btn-danger-soft:hover { background: #fdd9d9; border-color: transparent; }
.btn-sm { min-height: 30px; padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-icon { width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: 9px; }
.btn-icon svg { width: 17px; height: 17px; }
.btn-block { width: 100%; }
.btn-lg { min-height: 44px; padding: 10px 20px; font-size: 15px; }
.btn.is-loading { pointer-events: none; opacity: .75; }
.btn.is-loading svg { animation: spin .85s linear infinite; }
.btn .spinner { width: 15px; height: 15px; }

.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(37, 99, 235, .25); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .7s linear infinite;
}
.btn-primary .spinner, .btn-danger .spinner { border-color: rgba(255, 255, 255, .4); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- badges & dots ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.5;
  background: var(--surface-3); color: var(--muted); white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-online, .badge-success { background: var(--green-soft); color: var(--green); }
.badge-offline { background: #eef2f6; color: var(--muted); }
.badge-danger { background: var(--red-soft); color: var(--red); }
.badge-warn { background: var(--amber-soft); color: var(--amber); }
.badge-info { background: var(--brand-soft); color: var(--brand); }
.badge-running { background: var(--cyan-soft); color: var(--cyan); }
.badge-partial { background: var(--amber-soft); color: var(--amber); }
.dot-live { position: relative; }
.dot-live::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  border: 1px solid currentColor; opacity: .35; animation: liveRing 2s ease-out infinite;
}
@keyframes liveRing { 0% { transform: scale(.6); opacity: .5; } 100% { transform: scale(1.5); opacity: 0; } }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--line);
}
.card-title { font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.card-sub { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.card-body { padding: 18px 20px; }
.card-tight { padding: 0; }

/* ---------- shell ---------- */
.shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 50;
  width: 236px; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--sidebar) 0%, #0a1623 100%);
  color: var(--sidebar-ink);
  border-right: 1px solid rgba(255, 255, 255, .05);
}
.sidebar-head { padding: 22px 20px 18px; }
.brand { display: flex; align-items: center; gap: 11px; color: #fff; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 11px; overflow: hidden;
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .6);
}
.brand-logo svg { width: 100%; height: 100%; }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: .04em; }
.brand-tag { margin-top: 2px; font-size: 11px; color: #7f93a8; letter-spacing: .12em; }
.nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; }
.nav-section { padding: 14px 12px 8px; font-size: 11px; font-weight: 700; letter-spacing: .14em; color: #6d8197; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; margin-bottom: 3px;
  border-radius: 9px; color: #aebfd2; text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav-item.active { background: linear-gradient(90deg, rgba(37, 99, 235, .95), rgba(37, 99, 235, .65)); color: #fff; box-shadow: 0 8px 18px -12px rgba(37, 99, 235, 1); }
.nav-item svg { width: 18px; height: 18px; opacity: .9; }
.nav-badge { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #dbeafe; font-size: 11px; text-align: center; }
.nav-item.active .nav-badge { background: rgba(255, 255, 255, .22); }
.sidebar-foot { padding: 16px 18px 20px; border-top: 1px solid rgba(255, 255, 255, .07); }
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #3b82f6, #0ea5e9); color: #fff;
  font-size: 13px; font-weight: 700; text-transform: uppercase; flex: none;
}
.sidebar-user-meta { min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: #e8f0f8; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: #7f93a8; }
.sidebar-version { margin-top: 12px; font-size: 11px; color: #5f7389; letter-spacing: .04em; }

.main { min-height: 100vh; margin-left: 236px; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  min-height: 72px; padding: 12px 32px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; }
.page-heading { min-width: 0; }
.page-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.page-sub { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.auto-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 34px; padding: 5px 10px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--surface); color: var(--muted); font-size: 12.5px;
}
.auto-toggle:hover { border-color: var(--line-strong); color: var(--ink-2); }
.switch { width: 30px; height: 17px; border-radius: 999px; background: #cbd5e1; position: relative; transition: background .15s; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.auto-toggle.on .switch { background: var(--green); }
.auto-toggle.on .switch::after { transform: translateX(13px); }
.refresh-meta { font-size: 11.5px; color: var(--muted-2); white-space: nowrap; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 4px 4px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.user-chip .avatar { width: 26px; height: 26px; font-size: 11px; }
.user-chip-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.user-chip .btn-icon { width: 28px; height: 28px; min-height: 28px; color: var(--muted); }

.view { width: 100%; max-width: 1500px; margin: 0 auto; padding: 24px 32px 56px; }
.view-enter { animation: viewIn .22s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.nav-scrim { display: none; }

/* ---------- auth ---------- */
.auth {
  min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1fr) minmax(460px, 560px);
  background: var(--bg);
}
.auth-art {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px 56px; color: #e8f0f8;
  background:
    radial-gradient(800px 500px at 85% 5%, rgba(37, 99, 235, .4), transparent 65%),
    radial-gradient(700px 500px at 5% 100%, rgba(14, 116, 144, .35), transparent 60%),
    linear-gradient(145deg, #0a1725 0%, #0d2136 55%, #0b1c2e 100%);
}
.auth-art::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(148, 163, 184, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, .07) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(700px 500px at 50% 40%, #000, transparent 85%);
}
.auth-art > * { position: relative; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand .brand-logo { width: 44px; height: 44px; }
.auth-brand-name { font-size: 18px; font-weight: 700; letter-spacing: .06em; color: #fff; }
.auth-brand-sub { font-size: 11.5px; color: #8ba0b5; letter-spacing: .16em; margin-top: 2px; }
.auth-copy { max-width: 540px; padding: 40px 0; }
.auth-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .14em; color: #7dd3fc; }
.auth-eyebrow::before { content: ""; width: 24px; height: 1px; background: currentColor; }
.auth-headline { margin: 18px 0 16px; font-size: clamp(28px, 3.4vw, 42px); line-height: 1.22; font-weight: 700; letter-spacing: -.01em; color: #fff; }
.auth-headline span { color: #7dd3fc; }
.auth-lede { font-size: 14.5px; line-height: 1.8; color: #a9bdd1; max-width: 460px; }
.auth-features { display: grid; gap: 14px; margin-top: 34px; max-width: 470px; }
.auth-feature { display: flex; gap: 12px; align-items: flex-start; }
.auth-feature-icon { width: 34px; height: 34px; border-radius: 9px; background: rgba(125, 211, 252, .1); border: 1px solid rgba(125, 211, 252, .18); color: #7dd3fc; display: flex; align-items: center; justify-content: center; flex: none; }
.auth-feature-icon svg { width: 17px; height: 17px; }
.auth-feature-title { font-size: 13.5px; font-weight: 600; color: #e2ecf5; }
.auth-feature-desc { margin-top: 3px; font-size: 12.5px; line-height: 1.6; color: #8ba0b5; }
.auth-art-foot { font-size: 11.5px; color: #6f849a; letter-spacing: .04em; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 48px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card-head { margin-bottom: 26px; }
.auth-title { font-size: 25px; font-weight: 700; letter-spacing: -.01em; }
.auth-desc { margin-top: 8px; font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.auth-form { display: grid; gap: 16px; }
.auth-foot { margin-top: 22px; font-size: 12px; color: var(--muted-2); line-height: 1.7; }
.auth-mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 26px; }
.auth-mobile-brand .brand-logo { width: 36px; height: 36px; }
.auth-mobile-brand .brand-name { font-size: 15px; color: var(--ink); }

.form-error {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px; border-radius: 9px;
  background: var(--red-soft); color: var(--red); font-size: 12.5px; line-height: 1.5;
}
.form-error svg { width: 15px; height: 15px; margin-top: 1px; }
.form-note { display: flex; gap: 8px; padding: 10px 12px; border-radius: 9px; background: var(--brand-soft); color: #1e40af; font-size: 12.5px; line-height: 1.55; }
.form-note svg { width: 15px; height: 15px; margin-top: 1px; flex: none; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field-label .req { color: var(--red); margin-left: 2px; }
.field-hint { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--surface); padding: 9px 12px; font-size: 14px;
  transition: border-color .15s, box-shadow .15s; min-height: 40px;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.input:hover, .select:hover, .textarea:hover { border-color: #b2bfd0; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(37, 99, 235, .14); }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.checkbox-row { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; line-height: 1.55; color: var(--ink-2); cursor: pointer; }
.checkbox-row input[type="checkbox"] { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.radio-cards { display: grid; gap: 8px; max-height: 260px; overflow: auto; padding: 2px; }
.radio-card { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: border-color .15s, background .15s; }
.radio-card:hover { border-color: var(--line-strong); background: var(--surface-2); }
.radio-card input { margin-top: 3px; accent-color: var(--brand); }
.radio-card.selected { border-color: var(--brand-2); background: var(--brand-soft); }
.radio-card-title { font-size: 13px; font-weight: 600; }
.radio-card-sub { margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.file-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 132px; padding: 20px; border: 1.5px dashed var(--line-strong); border-radius: 11px;
  background: var(--surface-2); text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.file-drop:hover, .file-drop.dragover { border-color: var(--brand-2); background: var(--brand-soft); }
.file-drop svg { width: 26px; height: 26px; color: var(--muted); }
.file-drop-title { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.file-drop-sub { font-size: 11.5px; color: var(--muted); }
.file-drop.has-file { border-style: solid; border-color: var(--brand-2); background: var(--brand-soft); }
.file-input { display: none; }
.upload-progress { margin-top: 14px; }
.upload-progress-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; }

/* ---------- stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { position: relative; overflow: hidden; padding: 17px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-icon { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); }
.stat-icon svg { width: 19px; height: 19px; }
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.cyan { background: var(--cyan-soft); color: var(--cyan); }
.stat-icon.amber { background: var(--amber-soft); color: var(--amber); }
.stat-icon.ink { background: var(--surface-3); color: var(--ink-2); }
.stat-value { margin-top: 14px; font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 3px; }
.stat-label { margin-top: 5px; font-size: 12.5px; color: var(--muted); }
.stat-note { margin-top: 8px; font-size: 11.5px; color: var(--muted-2); }
.stat-note strong { color: var(--ink-2); font-weight: 600; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack { display: grid; gap: 20px; }

.site-list { display: grid; }
.site-row { display: flex; align-items: center; gap: 14px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.site-row:last-child { border-bottom: 0; }
.site-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-3); color: var(--ink-2); display: flex; align-items: center; justify-content: center; flex: none; }
.site-mark svg { width: 18px; height: 18px; }
.site-main { min-width: 0; flex: 1; }
.site-name { font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.site-meta { margin-top: 4px; font-size: 12px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.site-side { display: flex; align-items: center; gap: 12px; }
.site-count { text-align: right; font-size: 12px; color: var(--muted); }
.site-count strong { display: block; font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; }

.job-list { display: grid; }
.job-item { display: flex; gap: 12px; align-items: center; padding: 13px 20px; border-bottom: 1px solid var(--line); background: transparent; border-left: 0; border-right: 0; border-top: 0; text-align: left; width: 100%; transition: background .13s; }
.job-item:last-child { border-bottom: 0; }
.job-item:hover { background: var(--surface-2); }
.job-item-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--surface-3); color: var(--ink-2); display: flex; align-items: center; justify-content: center; flex: none; }
.job-item-icon svg { width: 16px; height: 16px; }
.job-item-main { min-width: 0; flex: 1; }
.job-item-title { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.job-item-meta { margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.job-item-side { text-align: right; }

.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.quick-action {
  flex: 1; min-width: 150px; display: flex; align-items: center; gap: 11px;
  padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface); text-align: left; transition: border-color .15s, box-shadow .15s, transform .1s;
}
.quick-action:hover { border-color: #c3d3e8; box-shadow: var(--shadow); transform: translateY(-1px); text-decoration: none; }
.quick-action-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; flex: none; }
.quick-action-icon svg { width: 17px; height: 17px; }
.quick-action-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.quick-action-sub { margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.section-gap { margin-top: 20px; }

/* ---------- toolbars ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 14px; }
.toolbar-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar-spacer { flex: 1; }
.toolbar .select { min-height: 34px; padding-top: 6px; padding-bottom: 6px; font-size: 13px; width: auto; min-width: 120px; }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 11px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.search-box .input { width: 220px; min-height: 34px; padding: 6px 11px 6px 33px; font-size: 13px; }
.toolbar-meta { font-size: 12px; color: var(--muted); white-space: nowrap; }

.selection-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 14px;
  border: 1px solid #bfdbfe; border-radius: 12px; background: #eff6ff;
}
.selection-count { font-size: 13px; font-weight: 650; color: #1e40af; }
.selection-bar .btn { min-height: 30px; padding: 5px 10px; font-size: 12.5px; }
.selection-bar .btn svg { width: 14px; height: 14px; }
.selection-spacer { flex: 1; }

/* ---------- tables ---------- */
.table-card { overflow: hidden; }
.table-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.table-title { font-size: 14px; font-weight: 700; }
.table-meta { margin-left: auto; font-size: 12px; color: var(--muted); }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line);
  font-size: 11.5px; font-weight: 650; color: var(--muted); text-align: left;
  white-space: nowrap; letter-spacing: .02em;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: #f8fbff; }
.data-table tbody tr.selected { background: #f2f7ff; }
.data-table .check-cell { width: 40px; padding-right: 0; }
.data-table input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--brand); vertical-align: middle; }
.cell-device { min-width: 170px; }
.device-name { font-size: 13.5px; font-weight: 650; display: flex; align-items: center; gap: 7px; }
.device-remark { margin-top: 3px; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
.job-row { cursor: pointer; }
.job-type-mini { display: inline-flex; width: 15px; height: 15px; color: var(--muted); }
.job-type-mini svg { width: 15px; height: 15px; }
.device-sub { margin-top: 3px; font-size: 11.5px; color: var(--muted-2); }
.cell-stack { display: grid; gap: 3px; }
.cell-main { font-size: 12.5px; color: var(--ink-2); }
.cell-sub { font-size: 11.5px; color: var(--muted); }
.resource-cell { min-width: 138px; display: grid; gap: 6px; }
.resource-line { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.resource-line span:first-child { width: 26px; }
.resource-line span:last-child { min-width: 32px; text-align: right; }
.meter { flex: 1; height: 5px; border-radius: 999px; background: #e8eef6; overflow: hidden; }
.meter-fill { height: 100%; border-radius: 999px; background: var(--brand-2); transition: width .3s; }
.meter-fill.warn { background: #f59e0b; }
.meter-fill.danger { background: #ef4444; }
.row-actions { display: flex; align-items: center; gap: 5px; justify-content: flex-end; }
.icon-btn {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted);
  transition: background .13s, color .13s, border-color .13s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red); }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 58px 24px; }
.empty-icon { width: 58px; height: 58px; border-radius: 16px; background: var(--surface-3); color: var(--muted); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.empty-icon svg { width: 26px; height: 26px; }
.empty-title { font-size: 15px; font-weight: 650; }
.empty-desc { margin-top: 6px; max-width: 400px; font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.empty-actions { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.loading-block { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 60px 20px; color: var(--muted); font-size: 13px; }
.error-block { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 50px 20px; text-align: center; }
.error-block .empty-icon { background: var(--red-soft); color: var(--red); }
.error-block p { color: var(--muted); font-size: 13px; }

/* ---------- progress ---------- */
.progress-track { height: 6px; border-radius: 999px; background: #e8eef6; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #3b82f6, #2563eb); transition: width .35s; }
.progress-fill.green { background: linear-gradient(90deg, #22c55e, #15803d); }
.progress-fill.red { background: linear-gradient(90deg, #f87171, #dc2626); }
.progress-fill.amber { background: linear-gradient(90deg, #fbbf24, #d97706); }
.progress-text { margin-top: 4px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress-cell { min-width: 130px; }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(7, 16, 28, .58);
  backdrop-filter: blur(3px);
  animation: overlayIn .16s ease both;
}
.modal-card {
  display: flex; flex-direction: column;
  width: 100%; max-width: 560px; max-height: calc(100vh - 48px);
  background: var(--surface); border-radius: 16px;
  box-shadow: var(--shadow-lg);
  animation: modalIn .2s cubic-bezier(.2, .8, .25, 1) both;
  overflow: hidden;
}
.modal-card.wide { max-width: 900px; }
.modal-card.narrow { max-width: 430px; }
.modal-head { display: flex; align-items: flex-start; gap: 14px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.modal-head-main { flex: 1; min-width: 0; }
.modal-title { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.modal-sub { margin-top: 5px; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.modal-close { width: 30px; height: 30px; min-height: 30px; flex: none; }
.modal-body { padding: 20px 22px; overflow: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.modal-foot .foot-left { margin-right: auto; font-size: 12px; color: var(--muted); }
.modal-foot .btn { min-width: 82px; }
@keyframes overlayIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.985); } }

.confirm-message { font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }
.warning-box { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--amber-soft); color: #92400e; font-size: 12.5px; line-height: 1.65; }
.warning-box svg { width: 17px; height: 17px; margin-top: 1px; flex: none; }
.danger-box { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--red-soft); color: #991b1b; font-size: 12.5px; line-height: 1.65; }
.danger-box svg { width: 17px; height: 17px; margin-top: 1px; flex: none; }
.info-box { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--brand-soft); color: #1e3a8a; font-size: 12.5px; line-height: 1.65; }
.info-box svg { width: 17px; height: 17px; margin-top: 1px; flex: none; }
.modal-section { margin-top: 18px; }
.modal-section:first-child { margin-top: 0; }
.modal-section-title { font-size: 12px; font-weight: 700; letter-spacing: .05em; color: var(--muted); margin-bottom: 9px; }
.recipient-list { display: flex; flex-wrap: wrap; gap: 6px; }
.recipient-chip { padding: 4px 9px; border-radius: 7px; background: var(--surface-3); font-size: 12px; color: var(--ink-2); }
.recipient-more { padding: 4px 9px; font-size: 12px; color: var(--muted); }

/* ---------- device detail ---------- */
.detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.detail-head-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.detail-head-icon svg { width: 21px; height: 21px; }
.detail-head-main { min-width: 0; flex: 1; }
.detail-hostname { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-site { margin-top: 4px; font-size: 12px; color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.detail-item { background: var(--surface); padding: 11px 13px; min-width: 0; }
.detail-label { font-size: 11px; color: var(--muted); }
.detail-value { margin-top: 4px; font-size: 12.5px; color: var(--ink-2); word-break: break-all; }
.action-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.action-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  min-height: 68px; padding: 10px 8px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-2);
  font-size: 12px; transition: border-color .13s, background .13s, color .13s;
}
.action-btn:hover { border-color: #c3d3e8; background: var(--surface-2); }
.action-btn svg { width: 18px; height: 18px; color: var(--muted); }
.action-btn:hover svg { color: var(--brand); }
.action-btn.danger:hover { border-color: #fecaca; background: var(--red-soft); color: var(--red); }
.action-btn.danger:hover svg { color: var(--red); }
.disk-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.disk-table th, .disk-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.disk-table th { color: var(--muted); font-size: 11px; font-weight: 600; background: var(--surface-2); }
.disk-table tr:last-child td { border-bottom: 0; }
.remark-row { display: flex; gap: 8px; }
.remark-row .input { min-height: 36px; }

/* ---------- installed software ---------- */
.software-toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 10px; }
.software-search { width: 260px; min-height: 34px; }
.software-meta { font-size: 12px; color: var(--muted); }
.software-status { display: flex; align-items: center; gap: 8px; min-height: 20px; font-size: 12px; color: var(--muted); }
.software-content { min-height: 180px; }
.software-table-wrap { max-height: 430px; overflow: auto; border: 1px solid var(--line); border-radius: 11px; }
.software-table { min-width: 720px; }
.software-table thead th { position: sticky; top: 0; z-index: 1; }
.software-table td { padding: 10px 13px; }
.software-table th:last-child, .software-table td:last-child { text-align: right; }
.software-name { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.software-actions { display: flex; justify-content: flex-end; }
.software-actions .btn { min-height: 28px; padding: 4px 9px; font-size: 12px; }
.software-actions .btn svg { width: 13px; height: 13px; }
.software-manual { display: inline-block; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.software-empty { padding: 42px 24px; }
.software-empty-search { padding: 46px 20px; text-align: center; }
@media (max-width: 720px) {
  .software-search { width: 100%; }
  .software-meta { order: 3; width: 100%; }
}

/* ---------- jobs detail ---------- */
.job-meta-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; }
.job-meta-item { min-width: 0; }
.job-meta-label { font-size: 11px; color: var(--muted); }
.job-meta-value { margin-top: 3px; font-size: 12.5px; font-weight: 550; word-break: break-all; }
.job-payload { margin-top: 14px; padding: 13px 15px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; font-size: 12.5px; line-height: 1.7; color: var(--ink-2); }
.job-payload strong { color: var(--ink); font-weight: 650; }
.targets-wrap { margin-top: 16px; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.targets-wrap .data-table th { background: var(--surface-2); }
.targets-wrap .data-table td { padding: 10px 12px; }
.screenshot-thumb { width: 54px; height: 34px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line-strong); background: var(--surface-3); cursor: zoom-in; display: block; }
.shot-preview { display: block; max-width: 100%; max-height: 68vh; margin: 0 auto; border-radius: 8px; }
.target-message { max-width: 320px; font-size: 12px; color: var(--ink-2); line-height: 1.5; word-break: break-word; }
.job-refresh-note { margin-top: 10px; font-size: 11.5px; color: var(--muted-2); display: flex; align-items: center; gap: 6px; }

/* ---------- packages ---------- */
.package-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.package-card { display: flex; flex-direction: column; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.package-top { display: flex; gap: 12px; align-items: flex-start; }
.package-icon { width: 42px; height: 42px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; flex: none; }
.package-icon svg { width: 20px; height: 20px; }
.package-main { min-width: 0; flex: 1; }
.package-name { font-size: 14.5px; font-weight: 680; line-height: 1.4; word-break: break-word; }
.package-version { margin-top: 3px; font-size: 12px; color: var(--muted); }
.package-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 11.5px; color: var(--muted); }
.package-args { margin-top: 12px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); word-break: break-all; }
.package-notes { margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.package-foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.package-foot-meta { flex: 1; min-width: 120px; font-size: 11px; color: var(--muted-2); line-height: 1.5; }
.muted-args { color: var(--muted); }

/* ---------- sites ---------- */
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.site-card { display: flex; flex-direction: column; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.site-card-head { display: flex; align-items: flex-start; gap: 12px; }
.site-card-icon { width: 42px; height: 42px; border-radius: 11px; background: var(--surface-3); color: var(--ink-2); display: flex; align-items: center; justify-content: center; flex: none; }
.site-card-icon svg { width: 20px; height: 20px; }
.site-card-name { font-size: 15px; font-weight: 680; word-break: break-word; }
.site-card-sub { margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.site-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 15px; }
.site-stat { padding: 10px 12px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); }
.site-stat-label { font-size: 11px; color: var(--muted); }
.site-stat-value { margin-top: 3px; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.site-stat-value small { font-size: 11.5px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.site-detail-list { margin-top: 13px; display: grid; gap: 6px; font-size: 11.5px; color: var(--muted); }
.site-detail-list div { display: flex; justify-content: space-between; gap: 10px; }
.site-detail-list span:last-child { color: var(--ink-2); text-align: right; word-break: break-all; }
.site-card-foot { display: flex; align-items: center; gap: 6px; margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.site-card-foot .btn { min-height: 30px; padding: 5px 9px; font-size: 12px; }

.code-block { position: relative; padding: 12px 14px; border-radius: 9px; background: #0d1b2a; color: #dbeafe; font-family: var(--mono); font-size: 12px; line-height: 1.7; overflow-x: auto; white-space: pre; }
.code-block.light { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: pre-wrap; word-break: break-all; }
.copy-row { display: flex; gap: 8px; align-items: stretch; }
.copy-row .code-block { flex: 1; min-width: 0; }
.copy-row .btn { flex: none; }
.token-secret { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
.steps { display: grid; gap: 14px; min-width: 0; }
.step { display: flex; gap: 12px; min-width: 0; }
.step-num { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; margin-top: 1px; }
.step-main { min-width: 0; flex: 1; }
.step-title { font-size: 13px; font-weight: 650; }
.step-desc { margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.65; }
.step-desc code { padding: 1px 5px; border-radius: 4px; background: var(--surface-3); font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }
.step .code-block { margin-top: 8px; }
.onboard-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.onboard-item { padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); min-width: 0; }
.onboard-label { font-size: 11px; color: var(--muted); }
.onboard-value { margin-top: 3px; font-size: 12px; font-weight: 600; word-break: break-all; }

/* ---------- account ---------- */
.account-grid { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 20px; align-items: start; }
.profile-card { padding: 24px; text-align: center; }
.profile-avatar { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #3b82f6, #0ea5e9); color: #fff; font-size: 24px; font-weight: 700; }
.profile-name { font-size: 18px; font-weight: 700; }
.profile-role { margin-top: 4px; font-size: 12px; color: var(--muted); }
.profile-info { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 9px; text-align: left; }
.profile-info-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.profile-info-row span:first-child { color: var(--muted); }
.profile-info-row span:last-child { color: var(--ink-2); font-weight: 550; }
.security-list { display: grid; gap: 12px; margin-top: 14px; }
.security-item { display: flex; gap: 10px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.security-item svg { width: 16px; height: 16px; color: var(--green); margin-top: 1px; flex: none; }

/* ---------- toast ---------- */
.toast-root { position: fixed; top: 18px; right: 18px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: flex-start; gap: 9px;
  min-width: 240px; max-width: min(400px, calc(100vw - 36px));
  padding: 11px 14px; border-radius: 10px;
  background: #0f2438; color: #e8f0f8; font-size: 13px; line-height: 1.5;
  box-shadow: 0 16px 40px -16px rgba(2, 8, 23, .6);
  opacity: 0; transform: translateY(-6px); transition: opacity .18s, transform .18s;
  pointer-events: auto;
}
.toast.show { opacity: 1; transform: none; }
.toast svg { width: 17px; height: 17px; margin-top: 1px; flex: none; }
.toast-success svg { color: #4ade80; }
.toast-error { background: #3a1113; }
.toast-error svg { color: #fca5a5; }
.toast-info svg { color: #7dd3fc; }
.toast-text { word-break: break-word; }

/* ---------- noscript ---------- */
.noscript { position: fixed; inset: 0; background: #fff; display: flex; align-items: center; justify-content: center; padding: 30px; text-align: center; font-size: 15px; }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-card:last-child { grid-column: span 3; }
}
@media (max-width: 1100px) {
  .overview-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .job-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .auth { grid-template-columns: 1fr minmax(420px, 480px); }
  .auth-art { padding: 40px; }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: 20px 0 60px -30px rgba(2, 8, 23, .5); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .nav-scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(7, 16, 28, .45); backdrop-filter: blur(1px); }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 20px; min-height: 64px; }
  .view { padding: 20px 20px 48px; }
  .auth-art { display: none; }
  .auth { grid-template-columns: 1fr; background: radial-gradient(900px 500px at 50% -20%, #dbeafe, transparent 70%), var(--bg); }
  .auth-main { padding: 32px 22px; min-height: 100vh; }
  .auth-mobile-brand { display: flex; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card:last-child { grid-column: auto; }
  .stat-card:last-child:nth-child(odd) { grid-column: span 2; }
  .account-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  .page-title { font-size: 18px; }
  .page-sub { display: none; }
  .topbar-actions { gap: 5px; }
  .refresh-meta { display: none; }
  .auto-toggle { padding: 4px 8px; font-size: 11.5px; }
  .user-chip-name { display: none; }
  .view { padding: 14px 12px 40px; }
  .stat-grid { gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 23px; }
  .stat-icon { width: 32px; height: 32px; border-radius: 9px; }
  .toolbar { padding: 10px; }
  .toolbar .select { flex: 1; min-width: 100px; }
  .search-box { flex: 1 1 100%; }
  .search-box .input { width: 100%; }
  .selection-bar { align-items: flex-start; }
  .selection-spacer { display: none; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-card { max-height: 94vh; border-radius: 16px 16px 0 0; max-width: 100%; }
  .modal-head, .modal-body { padding-left: 16px; padding-right: 16px; }
  .code-block { white-space: pre-wrap; word-break: break-all; }
  .modal-foot { padding: 12px 16px; }
  .modal-foot .btn { flex: 1; min-width: 0; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .job-meta-grid { grid-template-columns: 1fr 1fr; }
  .form-grid.two { grid-template-columns: 1fr; }
  .package-grid, .site-grid { grid-template-columns: 1fr; }
  .onboard-summary { grid-template-columns: 1fr; }
  .toast-root { top: 10px; right: 10px; left: 10px; align-items: stretch; }
  .toast { max-width: none; }
  .auth-main { padding: 24px 16px; }
  .auth-card { max-width: 100%; }
  .auth-title { font-size: 22px; }
  .site-row { padding: 13px 14px; }
  .site-count { display: none; }
  .card-head, .card-body { padding-left: 14px; padding-right: 14px; }
  .table-head { padding: 12px 14px; }
  .data-table th, .data-table td { padding: 10px 11px; }
  .btn { min-height: 34px; padding: 6px 11px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
