:root {
  /* Trend Micro brand: Trend Red #D71920, Guardian Red #6F0000 */
  --bg0: #0c0c0e;
  --bg1: #16161a;
  --bg2: #1f1f24;
  --line: #33333a;
  --text: #f3f3f5;
  --muted: #9a9aa3;
  --accent: #d71920;
  --accent-bright: #de543b;
  --accent-dim: #6f0000;
  --warn: #f0b429;
  --danger: #ff6b6b;
  --ok: #3ecf8e;
  --radius: 10px;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 520px at 8% -12%, rgba(215, 25, 32, 0.28) 0%, transparent 55%),
    radial-gradient(700px 420px at 100% 0%, rgba(111, 0, 0, 0.35) 0%, transparent 50%),
    var(--bg0);
}
a { color: var(--accent-bright); text-decoration: none; }
a:hover { color: #eda389; text-decoration: underline; }
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.nav {
  background: rgba(22, 22, 26, 0.94);
  border-right: 1px solid var(--line);
  padding: 1.25rem 1rem;
  display: flex; flex-direction: column; gap: 1.5rem;
}
.brand { display: flex; gap: .75rem; align-items: center; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent-bright), var(--accent) 45%, var(--accent-dim));
  color: #fff; font-weight: 800; letter-spacing: -.02em;
  box-shadow: 0 0 0 1px rgba(215, 25, 32, 0.35), 0 8px 20px rgba(111, 0, 0, 0.35);
}
.brand strong { display: block; font-size: .95rem; }
.brand small { color: var(--muted); }
.nav a {
  display: block; padding: .55rem .7rem; border-radius: 8px;
  color: var(--text); text-decoration: none; font-size: .92rem;
}
.nav a:hover { background: var(--bg2); color: #fff; }
.nav-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 1rem; }
.who strong { display: block; font-size: .85rem; }
.who small { color: var(--muted); font-size: .75rem; }
.link-muted { color: var(--muted); font-size: .85rem; }
.main { padding: 1.5rem 1.75rem 3rem; max-width: 1200px; }
.top h1 { margin: 0 0 1.25rem; font-size: 1.45rem; font-weight: 650; letter-spacing: -.02em; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 1.5rem; }
.stat {
  background: var(--bg1); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem;
  color: inherit; text-decoration: none; display: block;
  transition: border-color .15s ease, background .15s ease;
}
a.stat:hover { border-color: #5a5a68; background: var(--bg2); }
a.stat.is-active { border-color: #6a6a78; background: var(--bg2); box-shadow: inset 0 0 0 1px #6a6a78; }
.stat .n { font-size: 1.75rem; font-weight: 700; letter-spacing: -.03em; }
.stat .l { color: var(--muted); font-size: .85rem; margin-top: .2rem; }
.stat.warn .n { color: var(--warn); }
.stat.danger .n { color: var(--accent-bright); }
.panel {
  background: var(--bg1); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 1.25rem;
}
.panel h2 {
  margin: 0; padding: .85rem 1rem; font-size: .95rem;
  border-bottom: 1px solid var(--line); background: var(--bg2);
}
.toolbar {
  display: flex; flex-wrap: wrap; gap: .55rem; align-items: center;
  margin-bottom: 1rem;
}
.toolbar input[type="search"] {
  flex: 1 1 220px; min-width: 180px; max-width: 420px;
  font: inherit; color: var(--text); background: var(--bg0);
  border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem;
}
.toolbar-meta { font-size: .85rem; margin-left: .25rem; }
.th-sort {
  color: inherit; text-decoration: none; font: inherit;
  text-transform: inherit; letter-spacing: inherit;
}
.th-sort:hover { color: var(--text); text-decoration: underline; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: .65rem .85rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: rgba(255,255,255,.03); }
tr.row-link:focus { outline: none; }
tr.row-link:focus td { background: rgba(215, 25, 32, 0.08); }
.badge {
  display: inline-block; padding: .15rem .45rem; border-radius: 999px;
  font-size: .72rem; font-weight: 600;
}
.badge-ok { background: #143528; color: var(--ok); }
.badge-warn { background: #3a3218; color: var(--warn); }
.badge-danger { background: #3a1216; color: var(--accent-bright); }
.badge-muted { background: #2a2a30; color: var(--muted); }
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem .9rem; border-radius: 8px; border: 0;
  background: linear-gradient(180deg, var(--accent-bright), var(--accent));
  color: #fff; font-weight: 650; font-size: .9rem;
  cursor: pointer; text-decoration: none;
  box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 6px 16px rgba(215, 25, 32, 0.28);
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn-ghost {
  background: transparent; color: var(--text); border: 1px solid var(--line);
  box-shadow: none;
}
.btn-danger { background: var(--accent-dim); color: #fff; }
.form {
  display: grid; gap: .9rem; max-width: 560px; padding: 1rem;
}
label { display: grid; gap: .35rem; font-size: .85rem; color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg0);
  border: 1px solid var(--line); border-radius: 8px; padding: .6rem .7rem;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.2);
}
.row-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.flash {
  margin-bottom: 1rem; padding: .75rem .9rem; border-radius: 8px; font-size: .92rem;
}
.flash-ok { background: #143528; border: 1px solid #1f5a3c; }
.flash-err { background: #3a1216; border: 1px solid #6f0000; }
.mono { font-family: var(--mono); font-size: .8rem; }
.muted { color: var(--muted); }
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
}
.login-card {
  width: min(420px, 100%);
  background: rgba(22, 22, 26, 0.96);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 2rem 1.75rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.45), 0 0 0 1px rgba(215, 25, 32, 0.12);
}
.login-card h1 { margin: 0 0 .4rem; font-size: 1.4rem; }
.login-card p { margin: 0 0 1.25rem; color: var(--muted); line-height: 1.45; }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .nav { border-right: 0; border-bottom: 1px solid var(--line); }
  .nav nav { display: flex; flex-wrap: wrap; gap: .25rem; }
}
