:root {
  color-scheme: dark;
  font-family:
    Inter,
    system-ui,
    Segoe UI,
    sans-serif;
  background: #0a0e18;
  color: #e8effb;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
input {
  min-width: 0;
  background: #0e1726;
  border: 1px solid #344661;
  color: #f0f5fc;
  padding: 10px 12px;
  border-radius: 8px;
  outline: none;
}
input:focus {
  border-color: #56c8b9;
}
.hidden {
  display: none !important;
}
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(ellipse at 50% 15%, #143b40 0%, #0a0e18 55%);
}
.login-card {
  width: min(100%, 390px);
  padding: 32px;
  background: #131f30;
  border: 1px solid #2a3e55;
  border-radius: 17px;
  box-shadow: 0 30px 80px #0007;
  text-align: center;
}
.login-card .logo {
  font-size: 43px;
  color: #6ce3c5;
}
.login-card h1 {
  font-size: 21px;
  margin: 8px 0;
}
.login-card p {
  color: #8fa3bf;
  font-size: 12px;
}
.login-card label {
  display: block;
  text-align: left;
  font-size: 12px;
  color: #a8bbd3;
  margin-top: 20px;
}
.login-card input {
  display: block;
  width: 100%;
  margin-top: 8px;
}
.login-card button {
  width: 100%;
  margin-top: 24px;
}
.login-card small {
  display: block;
  margin-top: 20px;
  color: #7185a2;
}
.error {
  color: #ff90a0;
  font-size: 12px;
  margin-top: 12px;
  min-height: 18px;
}
.primary {
  background: #138f7b;
  color: white;
  border: 1px solid #239c89;
  border-radius: 8px;
  padding: 10px 13px;
  font-weight: 750;
}
.primary:hover {
  background: #1aa48d;
}
.small-button {
  background: #1c2a3f;
  border: 1px solid #344a60;
  color: #c7d6ed;
  padding: 8px 11px;
  border-radius: 7px;
  font-size: 12px;
}
.danger {
  background: #4a2633;
  color: #ffc1ca;
  border: 1px solid #774458;
  border-radius: 7px;
  padding: 8px 11px;
}
.layout {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 225px;
  background: #0f1725;
  border-right: 1px solid #243247;
  display: flex;
  flex-direction: column;
  padding: 23px 12px;
  flex: none;
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 0 9px 22px;
  border-bottom: 1px solid #28364a;
  margin-bottom: 16px;
}
.brand b {
  font-size: 12px;
}
.brand small {
  display: block;
  font-size: 10px;
  color: #7990af;
  margin-top: 4px;
}
.logo-sm {
  font-size: 31px;
  color: #60e4ce;
}
.nav-label {
  font-size: 10px;
  color: #6e83a0;
  letter-spacing: 0.12em;
  font-weight: 750;
  margin: 16px 10px 8px;
}
.nav {
  background: none;
  border: 1px solid transparent;
  color: #a0b1c9;
  width: 100%;
  text-align: left;
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 12px;
  display: flex;
  gap: 10px;
}
.nav.active {
  background: #193b3d;
  border-color: #286c66;
  color: #71e7d4;
}
.nav:hover {
  background: #1b2a3b;
}
.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid #28364a;
  padding: 15px 8px;
  color: #a6bbcf;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.main {
  flex: 1;
  min-width: 0;
  padding: 29px;
  max-width: 1600px;
}
.top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  margin-bottom: 24px;
}
.eyebrow {
  color: #65d6c4;
  font-size: 10px;
  letter-spacing: 0.15em;
  font-weight: 800;
}
.top h2 {
  font-size: 27px;
  letter-spacing: -0.04em;
  margin: 6px 0;
}
.top p {
  color: #8ca0ba;
  font-size: 12px;
  margin: 4px 0;
}
.pill {
  font-size: 10px;
  padding: 5px 8px;
  border-radius: 6px;
  background: #253751;
  color: #afcef9;
  font-weight: 750;
  white-space: nowrap;
}
.pill.green {
  background: #183e35;
  color: #77e5b6;
}
.pill.red {
  background: #432331;
  color: #ffa4ae;
}
.pill.yellow {
  background: #43351e;
  color: #f9d388;
}
.page {
  display: none;
}
.page.active {
  display: block;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 14px;
}
.stat {
  background: #141f30;
  border: 1px solid #2b3d55;
  border-radius: 12px;
  padding: 18px;
}
.stat b {
  font-size: 27px;
  display: block;
  margin: 12px 0;
}
.stat span {
  color: #93a8c2;
  font-size: 11px;
}
.card {
  background: #141f30;
  border: 1px solid #2b3d55;
  border-radius: 12px;
  padding: 17px;
  margin: 0 0 14px;
  overflow: auto;
}
.card h3 {
  font-size: 14px;
  margin: 0 0 16px;
}
.muted {
  color: #8da0ba;
  font-size: 11px;
  line-height: 1.6;
}
.module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  font-size: 12px;
  color: #84dfc7;
}
.flex {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.flex h3 {
  margin: 0 auto 0 0;
}
.flex input {
  flex: 1;
  min-width: 150px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  white-space: nowrap;
}
.data-table th {
  text-align: left;
  font-size: 10px;
  color: #879ab2;
  background: #1a293e;
  padding: 11px;
}
.data-table td {
  padding: 11px;
  border-top: 1px solid #28394f;
}
.data-table tr.clickable:hover {
  background: #203149;
  cursor: pointer;
}
.data-table button {
  font-size: 10px;
  padding: 6px 8px;
}
.detail-tabs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.detail-tabs button {
  background: #192b41;
  border: 1px solid #304963;
  color: #b9cce4;
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 11px;
}
.detail-tabs button.active {
  background: #194b47;
  color: #80f3db;
  border-color: #2b776e;
}
.profile-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}
.profile-head h3 {
  margin-bottom: 5px;
}
.flash {
  border: 1px solid #3f7d6c;
  background: #17382e;
  color: #a3f4d6;
  padding: 11px 14px;
  border-radius: 8px;
  margin-bottom: 15px;
  font-size: 12px;
}
.flash.error {
  border-color: #734456;
  background: #3c2531;
  color: #ffb5bf;
}
.empty {
  padding: 20px;
  color: #91a4bc;
  font-size: 12px;
}
.keyvalue {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 10px 20px;
  font-size: 12px;
}
.keyvalue dt {
  color: #8499b3;
}
.keyvalue dd {
  margin: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 780px) {
  .sidebar {
    width: 60px;
    padding: 15px 5px;
  }
  .brand {
    justify-content: center;
    padding: 0 0 18px;
  }
  .brand div,
  .nav span,
  .nav-label,
  .sidebar-bottom #currentActor {
    display: none;
  }
  .nav {
    justify-content: center;
    padding: 11px;
  }
  .main {
    padding: 16px 12px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .module-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .top h2 {
    font-size: 21px;
  }
  .keyvalue {
    grid-template-columns: 100px minmax(0, 1fr);
  }
}

.network-form {
  display: grid;
  grid-template-columns: minmax(110px, 0.75fr) minmax(170px, 1.3fr) minmax(170px, 1.5fr) auto;
  gap: 12px;
  align-items: end;
  margin: 12px 0;
}
.network-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 11px;
  color: #9db2cc;
}
.network-form input,
.network-form select,
#blacklistFilter {
  width: 100%;
  background: #0e1726;
  border: 1px solid #344661;
  border-radius: 8px;
  color: #f0f5fc;
  padding: 10px 12px;
  font-size: 12px;
}
.network-form button {
  min-height: 40px;
}
#blacklistSearch {
  flex: 1;
  min-width: 150px;
}
#blacklistFilter {
  width: auto;
  min-width: 95px;
}
@media (max-width: 1100px) {
  .network-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 540px) {
  .network-form {
    grid-template-columns: 1fr;
  }
}

.trend-chart {
  display: flex;
  align-items: end;
  gap: 12px;
  min-height: 190px;
  overflow-x: auto;
  padding: 10px 2px 0;
}
.trend-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 55px;
  flex: 1;
  color: #93a8bf;
  font-size: 10px;
}
.trend-bar {
  background: linear-gradient(180deg, #54e1ce, #1b6d8e);
  width: 70%;
  border-radius: 6px 6px 0 0;
  min-width: 22px;
}
.trend-col strong {
  font-size: 11px;
  color: #e6f1fb;
}
.trend-col small {
  font-size: 9px;
}
.password-form {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}
.password-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 11px;
  color: #a6b9d1;
}
.password-form input {
  min-width: 210px;
}
#ipResults .card {
  margin-top: 14px;
}
#ipResults h3 {
  margin-top: 23px;
}
select {
  background: #0e1726;
  border: 1px solid #344661;
  color: #f0f5fc;
  border-radius: 8px;
  padding: 10px 12px;
}

/* v4 staff self-registration and TS3 ban controls */
.auth-switch {
  width: 100%;
  margin-top: 12px;
}
#registerForm {
  margin-top: 15px;
  margin-bottom: 15px;
}
#registerForm .small-button {
  margin: 7px 0 12px;
}
.ban-form {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin: 13px 0;
  padding: 14px;
  border: 1px solid #61414f;
  border-radius: 11px;
  background: #291f30;
}
.ban-form h4 {
  width: 100%;
  margin: 0;
  color: #ffb6c2;
  font-size: 13px;
}
.ban-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: #c5d2e5;
  font-size: 11px;
}
.ban-form label:nth-of-type(2) {
  flex: 1;
  min-width: 180px;
}
.ban-form input,
.ban-form select {
  padding: 9px;
  background: #111d2c;
  border: 1px solid #45566e;
  border-radius: 7px;
  color: #f0f5fa;
}
.ban-form button {
  padding: 10px 13px;
}

/* Connection history pagination */
.activity-pagination {
  justify-content: flex-end;
  margin-top: 16px;
}
.activity-pagination #activityPageInfo {
  min-width: 155px;
  text-align: center;
}
#activitySearch {
  max-width: 360px;
}

/* SECURE_BOT_TS3 - Compact desktop layout (2026-11-27) */
@media (min-width: 781px) {
  .sidebar {
    width: 192px;
    padding: 14px 9px;
  }
  .brand {
    padding: 0 6px 13px;
    margin-bottom: 7px;
  }
  .brand b {
    font-size: 11px;
  }
  .logo-sm {
    font-size: 26px;
  }
  .nav-label {
    margin: 11px 8px 4px;
    font-size: 9px;
  }
  .nav {
    padding: 8px 9px;
    gap: 8px;
    font-size: 11px;
  }
  .sidebar-bottom {
    padding: 10px 6px;
  }
  .main {
    padding: 18px 20px;
    max-width: none;
  }
  .top {
    margin-bottom: 14px;
  }
  .top h2 {
    font-size: 22px;
  }
  .stats {
    gap: 9px;
    margin-bottom: 10px;
  }
  .stat {
    padding: 12px 14px;
  }
  .stat b {
    font-size: 23px;
    margin: 7px 0;
  }
  .card {
    padding: 13px 14px;
    margin-bottom: 10px;
  }
  .card h3 {
    margin-bottom: 10px;
  }
  .flex {
    gap: 8px;
    margin-bottom: 9px;
  }
  .flex input,
  .flex select {
    padding: 7px 9px;
  }
  .data-table {
    font-size: 11px;
  }
  .data-table th {
    padding: 8px 9px;
    font-size: 10px;
  }
  .data-table td {
    padding: 7px 9px;
    line-height: 1.35;
  }
  .data-table button {
    padding: 5px 7px;
  }
  .activity-pagination {
    margin-top: 10px;
  }
  .pill {
    padding: 3px 6px;
  }
  .trend-chart {
    min-height: 150px;
  }
}

/* Keep wide tables usable instead of squeezing UID, IP and timestamps. */
.card:has(.data-table) {
  overflow-x: auto;
}
.data-table td,
.data-table th {
  vertical-align: middle;
}

@media (max-width: 780px) {
  .main {
    padding: 12px 9px;
  }
  .card {
    padding: 11px;
  }
  .data-table th {
    padding: 8px;
  }
  .data-table td {
    padding: 8px;
  }
}
