/* shadcn/ui "zinc" design tokens, reproduced as plain CSS (shadcn itself is React + Tailwind).
   To re-theme later, change only the variables below. */
:root[data-theme="light"] {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --border: 240 5.9% 90%;
  --primary: 240 5.9% 10%;
  --primary-foreground: 0 0% 98%;
  --destructive: 0 72% 51%;
  --ring: 240 5.9% 10%;
  --ok: 142 70% 35%;
  --warn: 38 92% 42%;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  --card: 240 10% 3.9%;
  --muted: 240 3.7% 15.9%;
  --muted-foreground: 240 5% 64.9%;
  --border: 240 3.7% 15.9%;
  --primary: 0 0% 98%;
  --primary-foreground: 240 5.9% 10%;
  --destructive: 0 62% 55%;
  --ring: 240 4.9% 83.9%;
  --ok: 142 60% 50%;
  --warn: 38 92% 55%;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: hsl(var(--background)); color: hsl(var(--foreground));
  font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.muted { color: hsl(var(--muted-foreground)); }

/* header */
.header { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; border-bottom: 1px solid hsl(var(--border)); }
.brand { font-weight: 600; font-size: 16px; }
.brand span { color: hsl(var(--muted-foreground)); font-weight: 400; }
.avatar { width: 36px; height: 36px; border-radius: 9999px; border: 1px solid hsl(var(--border)); background: hsl(var(--muted)); color: hsl(var(--foreground)); font-weight: 600; cursor: pointer; font-size: 13px; }
.avatar:hover { border-color: hsl(var(--ring)); }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: 44px; min-width: 220px; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: 8px; padding: 4px; z-index: 20; box-shadow: 0 8px 24px rgb(0 0 0 / .35); }
.menu .who { padding: 8px 10px; border-bottom: 1px solid hsl(var(--border)); margin-bottom: 4px; }
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; color: inherit; padding: 8px 10px; border-radius: 6px; cursor: pointer; font: inherit; }
.menu button:hover { background: hsl(var(--muted)); }

/* layout */
.page { padding: 20px 24px; max-width: 1400px; margin: 0 auto; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .grow { flex: 1 1 260px; min-width: 200px; }
.spacer { flex: 1; }

/* controls */
.input, .select, .textarea {
  height: 36px; padding: 0 12px; border-radius: 6px; font: inherit;
  background: transparent; color: hsl(var(--foreground)); border: 1px solid hsl(var(--border));
}
.select { padding-right: 8px; }
.select option { background: hsl(var(--background)); color: hsl(var(--foreground)); }
.textarea { height: auto; padding: 8px 12px; width: 100%; min-height: 72px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus, .btn:focus-visible, .avatar:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 1px; }
.btn { height: 36px; padding: 0 14px; border-radius: 6px; font: inherit; font-weight: 500; cursor: pointer; border: 1px solid transparent; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.btn:hover { opacity: .9; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.outline { background: transparent; color: hsl(var(--foreground)); border-color: hsl(var(--border)); }
.btn.outline:hover { background: hsl(var(--muted)); opacity: 1; }
.btn.danger { background: hsl(var(--destructive)); color: #fff; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-weight: 500; font-size: 13px; }
.error { color: hsl(var(--destructive)); font-size: 13px; min-height: 18px; }

/* table */
.table-wrap { border: 1px solid hsl(var(--border)); border-radius: 8px; overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; color: hsl(var(--muted-foreground)); padding: 10px 12px; border-bottom: 1px solid hsl(var(--border)); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid hsl(var(--border)); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.row { cursor: pointer; }
tbody tr.row:hover { background: hsl(var(--muted) / .5); }
td.nowrap { white-space: nowrap; }
td.summary { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 40px; text-align: center; color: hsl(var(--muted-foreground)); }
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 12px; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 9999px; border: 1px solid hsl(var(--border)); font-size: 12px; font-weight: 500; }
.badge.crash, .badge.anr { color: hsl(var(--destructive)); border-color: hsl(var(--destructive) / .5); }
.badge.new { color: hsl(var(--warn)); border-color: hsl(var(--warn) / .5); }
.badge.resolved { color: hsl(var(--ok)); border-color: hsl(var(--ok) / .5); }

/* dialog */
dialog { background: hsl(var(--card)); color: hsl(var(--foreground)); border: 1px solid hsl(var(--border)); border-radius: 10px; padding: 20px; width: min(900px, 94vw); max-height: 90vh; }
dialog.narrow { width: min(460px, 94vw); }
dialog::backdrop { background: rgb(0 0 0 / .6); }
.dlg-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 12px; }
.dlg-head h2 { margin: 0; font-size: 18px; }
.meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 16px; margin-bottom: 14px; }
.meta .k { font-size: 12px; color: hsl(var(--muted-foreground)); }
.meta .v { word-break: break-word; }
pre.log { margin: 0; padding: 12px; background: hsl(var(--muted) / .6); border: 1px solid hsl(var(--border)); border-radius: 6px; max-height: 40vh; overflow: auto; font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.card { width: min(380px, 100%); border: 1px solid hsl(var(--border)); border-radius: 10px; padding: 24px; }
.card h1 { margin: 0 0 4px; font-size: 20px; }

.row-actions.tight { margin: 0 0 8px; }
.mt { margin-top: 10px; }

/* sync hub */
.nav { display: flex; gap: 6px; align-items: center; }
.nav a { color: hsl(var(--muted-foreground)); text-decoration: none; padding: 6px 10px; border-radius: 6px; font-weight: 500; }
.nav a:hover { background: hsl(var(--muted)); }
.nav a.on { color: hsl(var(--foreground)); background: hsl(var(--muted)); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { border: 1px solid hsl(var(--border)); border-radius: 8px; padding: 10px 12px; }
.stat b { display: block; font-size: 22px; font-weight: 600; }
.banner { border: 1px solid hsl(var(--border)); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.banner.off { border-color: hsl(var(--destructive) / .6); }
.badge.on { color: hsl(var(--ok)); border-color: hsl(var(--ok) / .5); }
.badge.off, .badge.removed { color: hsl(var(--destructive)); border-color: hsl(var(--destructive) / .5); }
