:root {
  --bg: #f5f6f8;
  --fg: #1d2330;
  --muted: #6b7280;
  --card: #fff;
  --border: #e2e5ea;
  --accent: #3b5bdb;
  --ok: #2f9e44;
  --warn: #f08c00;
  --err: #e03131;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--fg);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; }

.app-header {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.75rem 1.5rem; background: var(--card); border-bottom: 1px solid var(--border);
}
.app-header h1 { font-size: 1.25rem; margin: 0; }
.tabs { display: flex; gap: 0.25rem; flex: 1; }
.tab { background: none; color: var(--fg); border: none; padding: 0.5rem 0.9rem; border-radius: 6px; cursor: pointer; }
.tab.active { background: var(--accent); color: #fff; }

.badge { font-size: 0.8rem; padding: 0.25rem 0.6rem; border-radius: 999px; background: var(--border); }
.badge.ok { background: #d3f9d8; color: var(--ok); }
.badge.warn { background: #fff3bf; color: var(--warn); }
.badge.err { background: #ffe3e3; color: var(--err); }

main { padding: 1.5rem; max-width: 1400px; margin: 0 auto; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.25rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.panel-head h2 { margin: 0; font-size: 1.1rem; }

.toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }
input, select, button { font: inherit; padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: 6px; }
button { background: var(--accent); color: #fff; border-color: var(--accent); cursor: pointer; }
button.secondary { background: var(--card); color: var(--fg); border-color: var(--border); }
button:disabled { opacity: 0.45; cursor: default; }

.status { font-size: 0.85rem; color: var(--muted); min-height: 1.2em; margin-bottom: 0.5rem; }
.status.error { color: var(--err); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: #f8f9fb; cursor: pointer; white-space: nowrap; user-select: none; }
tbody tr { cursor: pointer; }
tbody tr:hover, tbody tr:focus { background: #edf2ff; outline: none; }
.empty { color: var(--muted); padding: 1rem; }

.pager { display: flex; align-items: center; gap: 0.5rem; justify-content: flex-end; margin-top: 0.75rem; }

.detail {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw);
  background: var(--card); border-left: 1px solid var(--border); box-shadow: -4px 0 16px rgba(0,0,0,0.08);
  padding: 1rem 1.25rem; overflow-y: auto;
}
.detail header { display: flex; justify-content: space-between; align-items: center; }
.detail h3 { margin: 0; }
.detail dt { font-weight: 600; margin-top: 0.75rem; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; }
.detail dd { margin: 0.2rem 0 0; white-space: pre-wrap; word-break: break-word; }
