* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f7f7f8; --surface: #ffffff; --border: #e7e7ea; --ink: #16161a;
  --dim: #74747e; --faint: #a5a5ad; --danger: #dc2626; --ok: #16a34a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.04);
}
html { font-size: 15px; }
body { background: var(--bg); color: var(--ink); font-family: "Inter", system-ui, sans-serif; line-height: 1.5; min-height: 100vh; }
button { font-family: inherit; }

.btn { display: inline-block; background: var(--ink); color: #fff; border: 0; font-weight: 600; font-size: .9rem; padding: 9px 20px; border-radius: 8px; cursor: pointer; text-decoration: none; text-align: center; }
.btn:hover { background: #000; }
.btn:disabled { background: var(--border); color: var(--faint); cursor: default; }
.btn-lg { padding: 12px 30px; font-size: 1rem; }
.btn.outline { background: none; color: var(--ink); border: 1px solid var(--border); }
.btn.outline:hover { border-color: var(--faint); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { filter: brightness(.92); }
.btn.small { padding: 5px 12px; font-size: .78rem; border-radius: 6px; }

.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); padding: 56px 64px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; max-width: 440px; }
.auth-logo { width: 104px; height: 104px; object-fit: contain; margin-bottom: 6px; }
.auth-card h1 { font-size: 1.4rem; font-weight: 800; letter-spacing: -.01em; }
.auth-card p { color: var(--dim); font-size: .92rem; margin-bottom: 8px; }

.topbar { height: 60px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 22px; position: sticky; top: 0; z-index: 40; }
.ident { display: flex; align-items: center; gap: 11px; }
.mark { width: 34px; height: 34px; object-fit: contain; }
.ident-txt { display: flex; flex-direction: column; line-height: 1.15; }
.ident-name { font-weight: 700; font-size: .95rem; letter-spacing: -.01em; }
.ident-sub { font-size: .72rem; color: var(--dim); font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.quiet-link { color: var(--dim); font-size: .85rem; text-decoration: none; font-weight: 500; }
.quiet-link:hover { color: var(--ink); }

.shell { display: flex; min-height: calc(100vh - 60px); }
.side { width: 210px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border); padding: 18px 0 40px; position: sticky; top: 60px; height: calc(100vh - 60px); }
.side-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); font-weight: 700; padding: 6px 22px 8px; }
.side-item { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 22px; font-size: .89rem; color: var(--dim); cursor: pointer; font-weight: 500; border-left: 2px solid transparent; }
.side-item:hover { color: var(--ink); }
.side-item.active { color: var(--ink); font-weight: 600; border-left-color: var(--ink); background: var(--bg); }

.content { flex: 1; padding: 26px 30px 60px; max-width: 1080px; }
.empty { color: var(--faint); padding: 60px 0; text-align: center; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.stat .k { font-size: .74rem; color: var(--dim); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.stat .v { font-size: 1.35rem; font-weight: 800; margin-top: 2px; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.stat .v .st-dot { width: 9px; height: 9px; border-radius: 50%; }
.st-dot.up { background: var(--ok); }
.st-dot.down { background: var(--danger); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 18px; }
.panel h2 { font-size: 1.02rem; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 12px; letter-spacing: -.01em; }
.panel h3 { font-size: .78rem; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; margin: 20px 0 10px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hint { color: var(--faint); font-size: .8rem; margin-top: 12px; }

.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.seg-b { border: 0; background: none; padding: 7px 16px; font-size: .84rem; font-weight: 600; color: var(--dim); border-radius: 6px; cursor: pointer; }
.seg-b.active { background: var(--ink); color: #fff; }

table { width: 100%; border-collapse: collapse; margin: 4px 0; }
th { text-align: left; color: var(--faint); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; padding: 8px; border-bottom: 1px solid var(--border); font-weight: 700; }
td { padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: .88rem; }
tr:last-child td { border-bottom: 0; }
td.actions { text-align: right; white-space: nowrap; }
.flags { font-family: ui-monospace, monospace; font-size: .74rem; color: var(--dim); }

.form { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0; }
.form input, .form select { background: var(--bg); border: 1px solid var(--border); color: var(--ink); padding: 9px 12px; border-radius: 8px; outline: none; font: inherit; font-size: .87rem; min-width: 150px; }
.form input:focus, .form select:focus { border-color: var(--faint); background: var(--surface); }
textarea { width: 100%; min-height: 400px; background: #1b1b1f; color: #e8e8ec; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; font: 12.5px/1.55 ui-monospace, "Cascadia Code", monospace; margin: 12px 0; outline: none; }

#toast { position: fixed; bottom: 24px; right: 24px; transform: translateY(90px); background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 10px; font-weight: 600; font-size: .87rem; transition: transform .22s; z-index: 200; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
#toast.show { transform: translateY(0); }
#toast.bad.show { background: var(--danger); }

@media (max-width: 800px) {
  .side { position: fixed; left: 0; bottom: 0; top: auto; height: auto; width: 100%; display: flex; overflow-x: auto; border-top: 1px solid var(--border); border-right: 0; padding: 6px; z-index: 45; }
  .side-label { display: none; }
  .side-item { border-left: 0; white-space: nowrap; width: auto; }
  .content { padding-bottom: 110px; }
}
