:root {
  color-scheme: light;
  --ink: #18212f;
  --muted: #697586;
  --line: #dde3ea;
  --surface: #ffffff;
  --canvas: #f4f7fa;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --red: #c24148;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--canvas); }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; padding: 38px 0 34px; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 11px; font-weight: 750; letter-spacing: .12em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(25px, 4vw, 34px); line-height: 1.1; letter-spacing: 0; }
h2 { margin-bottom: 8px; font-size: 22px; line-height: 1.2; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; }
.status-dot.connected { background: #16a34a; }
.status-dot.error { background: var(--red); }
.intro-row { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.intro-row p { margin-bottom: 0; color: var(--muted); font-size: 14px; }
.button { min-height: 40px; border: 1px solid transparent; border-radius: 6px; padding: 0 16px; font-weight: 650; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.button-primary { color: #fff; background: var(--blue); }
.button-primary:hover { background: var(--blue-dark); }
.button-quiet { color: var(--ink); background: var(--surface); border-color: var(--line); }
.button-quiet:hover { border-color: #aeb9c7; background: #f9fafb; }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.search-field { flex: 1; }
.search-field input { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 6px; padding: 0 13px; color: var(--ink); background: var(--surface); outline: none; }
.search-field input:focus, label input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.table-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.table-meta { display: flex; justify-content: space-between; gap: 20px; min-height: 48px; align-items: center; border-bottom: 1px solid var(--line); padding: 0 18px; color: var(--muted); font-size: 13px; }
.error-message, .form-error { color: var(--red); }
.error-message:empty, .form-error:empty { display: none; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 12px 18px; color: var(--muted); background: #f8fafc; font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
td { padding: 16px 18px; border-top: 1px solid var(--line); font-size: 14px; white-space: nowrap; }
tbody tr:hover { background: #fbfdff; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.avatar { display: inline-grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; color: #1e40af; background: #dbeafe; font-size: 12px; font-weight: 800; }
.user-name { font-weight: 700; }
.email { color: var(--muted); }
.actions-heading, td:last-child { text-align: right; }
.row-actions { display: inline-flex; gap: 8px; }
.text-button { border: 0; padding: 3px 0; color: var(--blue); background: transparent; font-size: 13px; font-weight: 650; }
.text-button.delete { color: var(--red); }
.empty-state { display: grid; gap: 7px; place-items: center; min-height: 190px; color: var(--muted); font-size: 14px; }
.empty-state strong { color: var(--ink); font-size: 16px; }
dialog { width: min(440px, calc(100% - 32px)); border: 0; border-radius: 8px; padding: 0; color: var(--ink); box-shadow: 0 24px 80px rgba(15, 23, 42, .2); }
dialog::backdrop { background: rgba(15, 23, 42, .42); }
.dialog-card { display: grid; gap: 18px; padding: 25px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; }
.dialog-heading h2 { margin-bottom: 0; }
.icon-button { border: 0; padding: 0 4px; color: var(--muted); background: transparent; font-size: 26px; line-height: 1; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 650; }
label input { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 6px; padding: 0 12px; color: var(--ink); outline: none; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
@media (max-width: 680px) {
  .app-shell { width: min(100% - 24px, 1180px); }
  .topbar { padding-top: 24px; }
  .intro-row { align-items: flex-start; flex-direction: column; }
  .intro-row .button { width: 100%; }
  .toolbar { flex-direction: column; }
  .toolbar .button { width: 100%; }
  .table-meta { align-items: flex-start; flex-direction: column; gap: 4px; padding-top: 12px; padding-bottom: 12px; }
  th, td { padding-right: 13px; padding-left: 13px; }
}
