/* Admin console: one list of client instances, status first, destructive actions confirmed. */
body { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 28px; background: rgb(17 20 25 / .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--text); text-decoration: none; font-weight: 700; font-size: 16px; white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand-mark { width: 38px; height: 38px; flex: none; }
.brand-area { padding-left: 12px; border-left: 1px solid var(--line-2); color: var(--text-2); font-weight: 500; font-size: 14px; }
.account { display: flex; align-items: center; gap: 12px; min-width: 0; }
.account .caption { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { max-width: 1040px; margin: 0 auto; padding: 36px 28px 64px; }
.admin-nav { margin-bottom: 24px; }
.monitoring-open main { max-width: 1680px; }
.monitor-controls { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.monitor-controls .field { margin: 0; }
#monitorFrame { width: 100%; min-height: 78vh; height: 1100px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }

/* Sign-in: a single quiet card, the brand mark as the only ornament. */
.login { max-width: 400px; margin: min(12vh, 120px) auto 0; padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.login-mark { width: 64px; height: 64px; margin-bottom: 18px; }
.login h1 { font-size: 30px; }
.login > p { margin: 6px 0 26px; }
.login button.primary { width: 100%; min-height: 44px; margin-top: 6px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 30px; }
.page-head p { margin-top: 4px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input[type=search] { width: min(320px, 100%); }

.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--sunken); border: 1px solid var(--line); border-radius: 10px; }
.segmented button { min-height: 34px; padding: 6px 14px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font-size: 13.5px; }
.segmented button:hover { background: var(--surface-2); }
.segmented button[aria-selected=true] { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.segmented .count { color: var(--text-3); font-weight: 500; margin-left: 2px; }

.client-list { display: grid; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); overflow: hidden; }
.client { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 24px; padding: 18px 22px; border-top: 1px solid var(--line); }
.client:first-child { border-top: 0; }
.client-name { font-family: var(--serif); font-size: 18px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.client-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.client-note { margin-top: 8px; font-size: 13.5px; color: var(--text-2); max-width: 64ch; }
.client-note code { display: block; margin-top: 4px; color: var(--text-3); overflow-wrap: anywhere; }
.client-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.client[data-status=ARCHIVED] .client-name { color: var(--text-2); }

.empty { padding: 48px 24px; text-align: center; color: var(--text-2); background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius-l); }
#message { margin-bottom: 14px; }

.password-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
#register form { display: grid; gap: 16px; }
#confirm p { color: var(--text-2); max-width: 56ch; }

@media (max-width: 640px) {
  .topbar { padding: 10px 16px; }
  .brand-area, .account .role { display: none; }
  .toolbar input[type=search] { width: 100%; }
  main { padding: 24px 16px 48px; }
  .login { margin-top: 24px; padding: 24px 20px; }
  .page-head .primary { width: 100%; }
  .client { grid-template-columns: 1fr; padding: 16px; }
  .client-actions { justify-content: flex-start; }
  .client-actions > * { flex: 1 1 auto; }
  .password-row { grid-template-columns: 1fr 1fr; }
  .password-row input { grid-column: 1 / -1; }
}
