:root {
  --bg: #08111f;
  --panel: #101b2d;
  --panel-2: #14233a;
  --text: #f4f8ff;
  --muted: #9fb0c7;
  --line: #253650;
  --brand: #00d8ff;
  --danger: #ff5570;
  --ok: #59d98e;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif; background: radial-gradient(circle at top, #10213a 0, #0b1729 38%, var(--bg) 100%); background-attachment: fixed; color: var(--text); }
.shell { width: min(1180px, calc(100% - 32px)); min-height: 100vh; margin: 0 auto; padding: 32px 0 28px; display: flex; flex-direction: column; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(28px, 5vw, 44px); }
h2 { margin-bottom: 16px; }
.eyebrow { margin-bottom: 4px; color: var(--brand); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 800; }
.client-brand { display: inline-grid; gap: 4px; margin-bottom: 10px; }
.client-logo { display: block; width: 132px; max-width: 42vw; height: auto; object-fit: contain; border-radius: 6px; }
.client-brand span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.card { min-width: 0; background: rgba(16, 27, 45, .92); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.narrow { max-width: 460px; }
.stack { display: grid; gap: 14px; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: 380px 1fr; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 14px; }
.form-hint { margin: -4px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
input, select { width: 100%; padding: 12px 13px; background: #07101d; border: 1px solid var(--line); border-radius: 12px; color: var(--text); font: inherit; }
input:focus, select:focus { outline: 2px solid rgba(0,216,255,.35); border-color: var(--brand); }
.check { display: flex; align-items: center; gap: 10px; }
.check input { width: auto; }
button { border: 0; border-radius: 12px; padding: 12px 16px; background: var(--brand); color: #03101a; font-weight: 800; cursor: pointer; }
button:hover { filter: brightness(1.08); }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.danger { color: #fff; border-color: rgba(255,85,112,.4); background: rgba(255,85,112,.18); }
button.compact { width: auto; padding: 8px 10px; border-radius: 10px; font-size: 12px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.panel-switcher { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 18px; }
.switcher-fields { display: grid; grid-template-columns: minmax(220px, 320px) minmax(220px, 320px); gap: 12px; align-items: end; }
.panel-select-label { min-width: min(360px, 100%); color: var(--muted); }
.panel-switcher .eyebrow { margin-bottom: 8px; }
.monitor-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.monitor-card { display: grid; align-content: start; gap: 10px; min-height: 176px; padding: 18px; }
.monitor-card .eyebrow { margin-bottom: 0; }
.monitor-value { font-size: clamp(22px, 3vw, 30px); line-height: 1.05; font-weight: 900; color: var(--text); }
.monitor-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
.monitor-title { margin: 0; color: var(--text); font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.monitor-list { display: grid; gap: 8px; min-width: 0; }
.monitor-list.compact-list { gap: 5px; }
.monitor-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; }
.monitor-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.monitor-row strong { color: var(--brand); }
.monitor-mini-item { display: grid; gap: 3px; padding-top: 8px; border-top: 1px solid rgba(37,54,80,.7); }
.monitor-mini-item strong { font-size: 13px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.monitor-mini-item span, .monitor-empty { color: var(--muted); font-size: 12px; line-height: 1.3; }
.manual-collector-card button { width: 100%; margin-top: 2px; }
.monitor-note.success { color: var(--ok); }
.monitor-note.error { color: var(--danger); }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tab { background: var(--panel); color: var(--muted); border: 1px solid var(--line); }
.tab.active { color: #03101a; background: var(--brand); }
.panel { display: none; }
.panel.active { display: block; }
.list { display: grid; gap: 8px; max-height: 68vh; overflow: auto; padding-right: 4px; }
.list::-webkit-scrollbar { width: 8px; }
.list::-webkit-scrollbar-thumb { background: rgba(159,176,199,.22); border-radius: 999px; }
.item { display: grid; gap: 8px; padding: 11px 12px; border: 1px solid var(--line); background: var(--panel-2); border-radius: 14px; }
.item-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.item-head > div { min-width: 0; }
.item-title { font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.item-meta { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.item .actions { justify-content: flex-end; gap: 6px; }
.item .actions button { width: auto; padding: 7px 9px; border-radius: 9px; font-size: 12px; }
.badge { display: inline-flex; width: max-content; padding: 4px 8px; border-radius: 99px; font-size: 12px; font-weight: 800; background: rgba(159,176,199,.18); color: var(--muted); }
.badge.on { background: rgba(89,217,142,.15); color: var(--ok); }
.badge.off { background: rgba(255,85,112,.15); color: var(--danger); }
.toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
.toolbar h2 { margin-bottom: 0; }
.toolbar-actions { justify-content: flex-end; }
.toast { position: fixed; right: 18px; bottom: 18px; padding: 13px 16px; background: #03101a; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(3,10,18,.72); backdrop-filter: blur(6px); }
.modal-card { width: min(860px, 100%); max-height: min(86vh, 820px); overflow: auto; background: rgba(16,27,45,.98); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 24px 80px rgba(0,0,0,.5); padding: 20px; }
.modal-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.modal-head h2 { margin: 0; }
.modal-body { display: grid; gap: 14px; }
.preview-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.preview-stat { padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(7,16,29,.52); }
.preview-stat strong { display: block; color: var(--brand); font-size: 24px; line-height: 1; }
.preview-stat span { color: var(--muted); font-size: 12px; }
.preview-message { white-space: pre-wrap; overflow-wrap: anywhere; padding: 14px; border: 1px solid rgba(0,216,255,.24); border-radius: 14px; background: rgba(7,16,29,.64); color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.45; }
.preview-image { max-width: 100%; max-height: 260px; border-radius: 14px; border: 1px solid var(--line); object-fit: cover; }
.preview-panel-list { display: grid; gap: 8px; }
.preview-panel-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(20,35,58,.7); color: var(--muted); }
.preview-panel-row strong { color: var(--text); }
.preview-warning { padding: 11px 12px; border: 1px solid rgba(255,190,80,.34); border-radius: 12px; background: rgba(255,190,80,.1); color: #ffd99a; }
.modal-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding-top: 4px; }
.modal-actions button { width: auto; }
.support-footer { margin-top: auto; padding-top: 28px; display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; color: rgba(159,176,199,.72); font-size: 12px; }
.support-footer a { display: inline-flex; align-items: center; gap: 7px; color: rgba(244,248,255,.82); text-decoration: none; padding: 7px 10px; border: 1px solid rgba(37,54,80,.65); border-radius: 999px; background: rgba(7,16,29,.34); }
.support-footer a:hover { border-color: rgba(37,211,102,.55); color: #fff; }
.support-footer svg { width: 17px; height: 17px; fill: #25d366; }
@media (max-width: 980px) { .monitor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) { .grid.two { grid-template-columns: 1fr; } .topbar { align-items: flex-start; } }

.top-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; margin: 10px 0 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(7,16,29,.65); font-size: 13px; }
.status-pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 3px rgba(159,176,199,.12); }
.status-pill.ok { color: var(--ok); border-color: rgba(89,217,142,.35); }
.status-pill.ok::before { background: var(--ok); box-shadow: 0 0 0 3px rgba(89,217,142,.14); }
.status-pill.bad { color: var(--danger); border-color: rgba(255,85,112,.35); }
.status-pill.bad::before { background: var(--danger); box-shadow: 0 0 0 3px rgba(255,85,112,.14); }
.counter { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 28px; padding: 0 10px; border-radius: 999px; background: rgba(0,216,255,.12); color: var(--brand); font-size: 13px; font-weight: 900; }
.skeleton { min-height: 62px; border-radius: 14px; background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.1), rgba(255,255,255,.05)); background-size: 220% 100%; animation: shimmer 1.2s infinite linear; border: 1px solid var(--line); }
@keyframes shimmer { from { background-position: 220% 0; } to { background-position: -220% 0; } }
button:disabled { cursor: not-allowed; opacity: .58; filter: grayscale(.2); }
body.busy button, body.busy input, body.busy select { transition: opacity .15s ease; }
.toast.success { border-color: rgba(89,217,142,.5); }
.toast.error { border-color: rgba(255,85,112,.55); color: #ffdce3; }
.empty-state { padding: 18px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); background: rgba(7,16,29,.45); }
.qr-box { display: grid; gap: 10px; justify-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(7,16,29,.5); text-align: center; }
.qr-box p { margin: 0; color: var(--muted); font-size: 13px; }
.qr-box img { width: min(260px, 100%); border-radius: 12px; background: #fff; padding: 10px; }
@media (max-width: 560px) {
  .shell { width: min(100% - 20px, 1180px); padding-top: 20px; }
  .topbar { display: grid; }
  .client-logo { width: 116px; }
  .top-actions { width: 100%; }
  .top-actions button { flex: 1; }
  .panel-switcher { display: grid; align-items: stretch; }
  .switcher-fields { grid-template-columns: 1fr; }
  .monitor-grid { grid-template-columns: 1fr; }
  .tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .toolbar { align-items: flex-start; }
  button { width: 100%; }
  button.compact { width: auto; }
  .actions button { width: auto; }
  .item-head { gap: 8px; }
  .item .actions { justify-content: flex-start; }
  .support-footer { justify-content: flex-start; font-size: 11px; }
}
