/* NEXO Guard panel: brushed-silver surfaces, deep green chrome, soft curves. */
:root {
  --deep: #0b2218;
  --deep2: #12392a;
  --deep3: #1c5039;
  --green: #14994f;
  --green-hi: #3ddc84;
  --ink: #0f2218;
  --ink2: #425a4e;
  --mute: #7b8a83;
  --s0: #f6f8f7;
  --s1: #e5e9e7;
  --s2: #d2d8d5;
  --s3: #b4bdb9;
  --danger: #a8392e;
  --warn: #a8741a;
  --font: "Segoe UI Variable Text", "Segoe UI", "SF Pro Text", system-ui, sans-serif;
  --disp: "Segoe UI Variable Display", "Segoe UI Semibold", "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Mono", "Consolas", "Menlo", monospace;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 10px 28px -16px rgba(11, 34, 24, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--s1); }
body {
  font: 15px/1.45 var(--font); color: var(--ink); min-height: 100vh;
  background:
    radial-gradient(900px 420px at 85% -80px, #ffffff 0%, rgba(255, 255, 255, 0) 70%),
    radial-gradient(700px 500px at -10% 110%, rgba(20, 153, 79, 0.10), rgba(20, 153, 79, 0) 70%),
    linear-gradient(180deg, #eaeeec, #dde3e0);
  background-attachment: fixed;
}
[hidden] { display: none !important; }
a { color: inherit; }
::selection { background: var(--green-hi); color: var(--deep); }

/* ------------------------------------------------------------ header */
.shell { min-height: 100vh; }
.rail {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 28px;
  padding: 0 28px; height: 68px; color: #dfe6e2;
  background: linear-gradient(180deg, #123b2a 0%, #0b2218 100%);
  border-bottom: 1px solid #07160f;
  box-shadow: 0 8px 24px -14px rgba(5, 20, 13, 0.7);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.brand .mark { width: 38px; height: 38px; }
.brand .word { height: 15px; width: auto; }
.brand small { font: 600 10px var(--font); letter-spacing: 0.3em; text-transform: uppercase; color: var(--green-hi); margin-left: -2px; padding: 3px 0 0; }

#nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
#nav a { text-decoration: none; color: #aebdb6; font-size: 14px; font-weight: 500; padding: 8px 15px; border-radius: 999px; white-space: nowrap; transition: background 0.15s, color 0.15s; }
#nav a i { display: none; }
#nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.07); }
#nav a.on { color: #fff; background: linear-gradient(180deg, #1f9a5c, #14794a); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 4px 14px -6px rgba(61, 220, 132, 0.6); }
#nav .sep { width: 1px; background: rgba(255, 255, 255, 0.14); margin: 8px 8px; font-size: 0; padding: 0; }

.who { display: flex; align-items: center; gap: 12px; flex: none; }
.who .avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(145deg, #e9eeeb, #a3aeaa); color: var(--deep); font: 700 14px var(--disp); display: grid; place-items: center; }
.who .t { line-height: 1.15; }
#who-name { font-size: 13px; font-weight: 600; color: #fff; }
#who-role { font-size: 11px; color: var(--green-hi); text-transform: capitalize; }
.who .link { color: #aebdb6; font: 12px var(--font); text-decoration: none; margin-left: 4px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.18); }
.who .link:hover { color: #fff; border-color: rgba(255, 255, 255, 0.5); }

.main { max-width: 1280px; margin: 0 auto; padding: 22px 28px 70px; }

.strip { display: inline-flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; padding: 8px 18px; border-radius: 999px; font-size: 13px; color: var(--ink2); background: rgba(255, 255, 255, 0.65); border: 1px solid var(--s2); margin-bottom: 22px; }
.strip b { color: var(--ink); font-weight: 600; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--s3); margin-right: 8px; }
.dot.on { background: var(--green); box-shadow: 0 0 0 0 rgba(20, 153, 79, 0.5); animation: pulse 2.2s infinite; }
.dot.off { background: var(--danger); }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(20, 153, 79, 0); } 100% { box-shadow: 0 0 0 0 rgba(20, 153, 79, 0); } }

#page { max-width: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font: 600 32px/1.1 var(--disp); letter-spacing: -0.015em; }
.page-head h1 i { display: none; }
.page-head .tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

h2 { font: 600 13px var(--font); letter-spacing: 0.02em; color: var(--ink2); margin: 30px 0 12px; display: flex; align-items: center; gap: 10px; }
h2::after { content: ""; height: 1px; flex: 1; background: linear-gradient(90deg, var(--s3), transparent); }
h2:first-child { margin-top: 0; }

/* ------------------------------------------------------------ figures */
.figs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 8px; }
.fig { background: var(--s0); border: 1px solid var(--s2); border-radius: 22px; padding: 18px 22px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.fig::after { content: ""; position: absolute; right: -26px; top: -26px; width: 90px; height: 90px; border-radius: 50%; border: 1px solid var(--s2); box-shadow: 0 0 0 14px rgba(180, 189, 185, 0.18); }
.fig .v { font: 600 42px/1 var(--disp); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; position: relative; }
.fig .v.hot { color: var(--green); }
.fig .l { font-size: 13px; color: var(--mute); margin-top: 8px; position: relative; }

.two { display: grid; grid-template-columns: 1.7fr 1fr; gap: 20px; align-items: start; }
.chart { background: var(--s0); border: 1px solid var(--s2); border-radius: 22px; padding: 16px 18px 10px; box-shadow: var(--shadow); }
.chart svg { display: block; width: 100%; height: 170px; overflow: visible; }
.chart .area { fill: url(#cg); }
.chart .line { fill: none; stroke: var(--green); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chart .grid { stroke: var(--s2); stroke-width: 1; stroke-dasharray: 3 5; }
.chart .pt { fill: var(--s0); stroke: var(--green); stroke-width: 2; }
.chart .tick { font: 10px var(--font); fill: var(--mute); }
.chart-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--mute); padding: 6px 2px 4px; }

.rank { list-style: none; background: var(--s0); border: 1px solid var(--s2); border-radius: 22px; padding: 6px 20px; box-shadow: var(--shadow); }
.rank li { display: flex; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--s1); font-size: 14px; }
.rank li:last-child { border-bottom: 0; }
.rank li span:last-child { font-weight: 600; color: var(--green); font-variant-numeric: tabular-nums; }
.rank li.none { color: var(--mute); font-size: 13px; display: block; padding: 18px 0; }

/* ------------------------------------------------------------ tables */
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--s0); border: 1px solid var(--s2); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; }
th { font-size: 12px; color: var(--mute); text-align: left; font-weight: 600; padding: 13px 16px; border-bottom: 1px solid var(--s2); background: linear-gradient(180deg, #fbfcfb, #eef1f0); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--s1); vertical-align: top; font-size: 14px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #eef5f1; }
td.mono, .mono { font-family: var(--mono); font-size: 12px; }
td.dim, .dim { color: var(--mute); }
td.r, th.r { text-align: right; }
td.wrap { word-break: break-word; max-width: 360px; }
td .sub { display: block; font: 11px var(--mono); color: var(--mute); margin-top: 3px; word-break: break-all; }
.empty { padding: 36px 20px; color: var(--mute); font-size: 14px; background: var(--s0); border: 1px dashed var(--s3); border-radius: 22px; text-align: center; }

.tag { display: inline-block; font: 600 11px var(--font); padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: var(--s1); color: var(--ink2); text-transform: capitalize; }
.tag.warn, .tag.kick { background: #f4e8cf; color: var(--warn); }
.tag.ban { background: #f1d9d5; color: var(--danger); }
.tag.ok, .tag.owner { background: #d5eddf; color: #0d6b38; }
.tag.admin { background: #dfe9e3; color: var(--deep3); }
.tag.mod { background: #e6ece9; color: var(--ink2); }
.tag.off, .tag.viewer { background: var(--s1); color: var(--mute); }

/* ------------------------------------------------------------ controls */
input, select, textarea { background: #fcfdfc; border: 1px solid var(--s3); color: var(--ink); font: 14px var(--font); padding: 9px 14px; outline: none; border-radius: 12px; transition: border-color 0.15s, box-shadow 0.15s; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(20, 153, 79, 0.18); }
input[type=search] { min-width: 250px; border-radius: 999px; padding-left: 18px; }
input.mono-in { font-family: var(--mono); font-size: 13px; }
select { padding-right: 10px; }

.btn { background: var(--s0); color: var(--ink); border: 1px solid var(--s3); font: 600 13px var(--font); padding: 9px 18px; cursor: pointer; border-radius: 999px; transition: all 0.15s; }
.btn:hover { border-color: var(--green); color: var(--deep3); }
.btn.primary { background: linear-gradient(180deg, #1fa862, #138a48); color: #fff; border-color: #0f7a40; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 6px 16px -8px rgba(20, 153, 79, 0.8); }
.btn.primary:hover { filter: brightness(1.07); color: #fff; }
.btn.danger { color: var(--danger); border-color: #d9aaa4; }
.btn.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.small { padding: 5px 13px; font-size: 12px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.link { background: none; border: 0; cursor: pointer; }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; align-items: end; margin-bottom: 14px; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--ink2); }
label input, label select { display: block; width: 100%; margin-top: 6px; font-weight: 400; }
label small { color: var(--mute); font-weight: 400; }
.msg { font-size: 13px; color: var(--danger); min-height: 18px; }
.hint { font-size: 14px; color: var(--ink2); line-height: 1.55; max-width: 720px; margin-bottom: 14px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.block { background: var(--s0); border: 1px solid var(--s2); border-radius: 22px; padding: 22px 24px; margin-bottom: 18px; max-width: 680px; box-shadow: var(--shadow); }
.block h2 { margin-top: 0; }
.secretbox { font: 13px var(--mono); padding: 12px 14px; background: #eaf0ed; border: 1px dashed var(--s3); border-radius: 14px; word-break: break-all; user-select: all; margin-bottom: 12px; }

.toggle { width: 42px; height: 24px; background: var(--s3); border: 0; border-radius: 999px; position: relative; cursor: pointer; padding: 0; display: inline-block; vertical-align: middle; transition: background 0.2s; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: left 0.2s; }
.toggle.on { background: var(--green); }
.toggle.on::after { left: 21px; }
.toggle:disabled { opacity: 0.45; cursor: not-allowed; }

/* ------------------------------------------------------------ modal / toast */
.overlay { position: fixed; inset: 0; background: rgba(7, 24, 16, 0.55); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; z-index: 10; }
.modal { background: var(--s0); border: 1px solid var(--s2); border-radius: 26px; width: min(480px, 92vw); padding: 26px 28px 24px; box-shadow: 0 30px 70px -20px rgba(5, 20, 13, 0.6); }
.modal h3 { font: 600 22px var(--disp); text-transform: capitalize; margin-bottom: 4px; }
.modal .who-line { font: 12px var(--mono); color: var(--mute); margin-bottom: 18px; word-break: break-all; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.toast { position: fixed; right: 26px; bottom: 26px; background: var(--deep); color: #e8efeb; padding: 12px 20px; border-radius: 999px; font-size: 14px; z-index: 20; border-left: 4px solid var(--green-hi); box-shadow: 0 14px 30px -12px rgba(5, 20, 13, 0.7); }
.toast.err { border-left-color: #ee7a6d; }

/* ------------------------------------------------------------ auth pages */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 1.1fr) minmax(360px, 0.9fr); }
.auth-brand {
  padding: 56px 60px; display: flex; flex-direction: column; justify-content: space-between; color: #dfe8e3; position: relative; overflow: hidden;
  background:
    radial-gradient(520px 520px at 78% 70%, rgba(61, 220, 132, 0.22), rgba(61, 220, 132, 0) 70%),
    linear-gradient(155deg, #14452f 0%, #0b2218 60%, #071710 100%);
}
.auth-brand::before, .auth-brand::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(214, 224, 219, 0.14); }
.auth-brand::before { width: 620px; height: 620px; right: -220px; bottom: -240px; box-shadow: 0 0 0 70px rgba(214, 224, 219, 0.035), 0 0 0 140px rgba(214, 224, 219, 0.025); }
.auth-brand::after { width: 260px; height: 260px; right: 40px; bottom: 60px; border-color: rgba(61, 220, 132, 0.35); }
.auth-logo { position: relative; z-index: 1; display: flex; align-items: center; gap: 18px; }
.auth-logo .mark { width: 74px; height: 74px; }
.auth-logo .word { height: 30px; }
.auth-logo small { display: block; font: 600 11px var(--font); letter-spacing: 0.34em; color: var(--green-hi); text-transform: uppercase; margin-top: 10px; }
.auth-sub { position: relative; z-index: 1; font-size: 15px; color: #a9b9b1; line-height: 1.7; max-width: 400px; }
.auth-sub b { color: #fff; font: 600 30px/1.2 var(--disp); display: block; margin-bottom: 12px; letter-spacing: -0.01em; }
.auth-form { padding: 56px 52px; display: flex; flex-direction: column; justify-content: center; max-width: 520px; width: 100%; margin: 0 auto; }
.auth-form h1 { font: 600 30px var(--disp); letter-spacing: -0.015em; margin-bottom: 4px; }
.auth-form .btn { padding: 13px 18px; font-size: 14px; }
.auth-form input { padding: 12px 16px; }

@media (max-width: 900px) {
  .rail { height: auto; flex-wrap: wrap; padding: 12px 16px; gap: 10px; }
  #nav { order: 3; flex-basis: 100%; }
  .who .t { display: none; }
  .figs { grid-template-columns: 1fr 1fr; }
  .two { grid-template-columns: 1fr; }
  .main { padding: 18px 14px 50px; }
  table { display: block; overflow-x: auto; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-brand { padding: 32px 26px; gap: 28px; min-height: 280px; }
  .auth-form { padding: 32px 26px; }
}
