:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --text: #111111;
  --muted: #6e6e73;
  --line: #e5e5e7;
  --soft: #f8f8fa;
  --danger: #b42318;
  --success: #147a3d;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); min-width: 1040px; }
button, input, select, textarea { font: inherit; }
.app-shell { width: 100%; max-width: 1366px; min-height: 100vh; margin: 0 auto; display: grid; grid-template-columns: 240px 1fr; background: var(--bg); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 18px; border-right: 1px solid var(--line); background: rgba(255,255,255,.78); backdrop-filter: blur(20px); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: #000; color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); margin-top: 2px; }
nav { display: grid; gap: 5px; }
nav button { border: 0; background: transparent; text-align: left; padding: 11px 13px; border-radius: 11px; color: #3a3a3c; cursor: pointer; }
nav button:hover { background: #efeff1; }
nav button.active { background: #000; color: #fff; }
.sidebar-footer { margin-top: auto; display: flex; align-items: center; gap: 9px; padding: 13px; color: var(--muted); font-size: 13px; }
#connection-dot { width: 8px; height: 8px; border-radius: 50%; background: #b8b8bd; }
#connection-dot.ok { background: var(--success); }
main { padding: 34px 40px 70px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: 30px; letter-spacing: -.03em; }
h2 { font-size: 21px; letter-spacing: -.02em; }
h3 { font-size: 16px; }
.topbar p, .muted { color: var(--muted); }
.grid { display: grid; gap: 16px; }
.metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid rgba(0,0,0,.06); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(0,0,0,.03); padding: 22px; }
.metric span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.metric strong { font-size: 30px; letter-spacing: -.04em; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 30px 0 14px; }
.section-head h2 { margin: 0; }
.button { border: 1px solid #000; border-radius: 11px; padding: 10px 14px; background: #000; color: #fff; cursor: pointer; font-weight: 650; }
.button:hover { opacity: .82; }
.button.secondary { background: #fff; color: #000; border-color: var(--line); }
.button.danger { background: #fff; color: var(--danger); border-color: #f0c5c0; }
.button.small { padding: 7px 10px; border-radius: 9px; font-size: 13px; }
.toolbar { display: flex; gap: 10px; align-items: center; }
.table-wrap { overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: #fbfbfc; }
tr:last-child td { border-bottom: 0; }
tbody tr[data-id] { cursor: pointer; }
tbody tr[data-id]:hover { background: #fafafa; }
.badge { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 999px; background: #eeeeef; font-size: 12px; }
.badge.active, .badge.published, .badge.processed { background: #e7f6ec; color: var(--success); }
.badge.suspended, .badge.failed, .badge.withdrawn { background: #fff0ee; color: var(--danger); }
form.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
label { display: grid; gap: 7px; font-size: 13px; font-weight: 650; }
label.full, .form-actions { grid-column: 1 / -1; }
input, select, textarea { width: 100%; border: 1px solid #d7d7da; border-radius: 11px; padding: 11px 12px; background: #fff; color: #111; outline: none; }
input:focus, select:focus, textarea:focus { border-color: #000; box-shadow: 0 0 0 3px rgba(0,0,0,.06); }
textarea { min-height: 100px; resize: vertical; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.empty { padding: 44px; text-align: center; color: var(--muted); }
.notice { margin-bottom: 18px; padding: 13px 16px; border-radius: 12px; background: #fff7e6; border: 1px solid #f1d49a; }
.notice.error { background: #fff0ee; border-color: #f0c5c0; color: var(--danger); }
.notice.success { background: #eaf7ee; border-color: #b9dfc5; color: var(--success); }
.hidden { display: none !important; }
dialog { border: 0; padding: 0; background: transparent; width: min(760px, calc(100vw - 60px)); }
dialog::backdrop { background: rgba(0,0,0,.25); backdrop-filter: blur(6px); }
.modal-card { background: #fff; border-radius: 22px; box-shadow: 0 24px 80px rgba(0,0,0,.2); padding: 24px; max-height: 88vh; overflow: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-head h2 { margin: 0; }
.icon-button { border: 0; background: #efeff1; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 22px; line-height: 1; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.code { padding: 12px; border-radius: 10px; background: #f3f3f5; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.tabs { display: flex; gap: 8px; margin: 0 0 18px; }
.tabs button { border: 1px solid var(--line); background: #fff; padding: 8px 11px; border-radius: 9px; cursor: pointer; }
.tabs button.active { background: #000; border-color: #000; color: #fff; }
@media (max-width: 1180px) { .metrics { grid-template-columns: repeat(2, 1fr); } main { padding-left: 28px; padding-right: 28px; } }
