:root {
  color-scheme: dark;
  --bg: #070f1b;
  --bg-alt: #0b1626;
  --card: rgba(12, 24, 41, 0.92);
  --card-strong: rgba(14, 30, 52, 0.96);
  --stroke: rgba(90, 130, 190, 0.35);
  --text: #e6f0ff;
  --muted: #9cb0c9;
  --accent: #2aa9ff;
  --accent-2: #4c63ff;
  --accent-3: #1ce0ff;
  --success: #2ad69f;
  --danger: #ff5b6b;
  --shadow: 0 20px 50px rgba(0, 10, 30, 0.55);
  --radius: 20px;
  --radius-sm: 12px;
  --transition: 0.2s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", "Manrope", "Montserrat", sans-serif;
  background: radial-gradient(circle at 20% 20%, #102643 0%, #0a1424 45%, #070f1b 100%);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 48px;
  background: rgba(8, 16, 28, 0.78);
  border-bottom: 1px solid rgba(80, 120, 180, 0.3);
  backdrop-filter: blur(16px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-badge {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: 0 10px 24px rgba(44, 120, 255, 0.4);
}

.brand-title {
  font-size: 20px;
  font-weight: 700;
}

.brand-sub {
  font-size: 13px;
  color: var(--muted);
}

.userbar {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.nav-link {
  font-size: 13px;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color var(--transition), border var(--transition), background var(--transition);
}

.nav-link:hover {
  color: #fff;
  border-color: rgba(120, 170, 230, 0.4);
  background: rgba(18, 34, 56, 0.8);
}

.nav-link.is-active {
  color: #fff;
  border-color: rgba(90, 160, 255, 0.6);
  background: rgba(20, 40, 70, 0.9);
  box-shadow: 0 8px 18px rgba(30, 110, 230, 0.3);
}

.user-info {
  text-align: right;
}

.user-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.main {
  padding: 32px 48px 80px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  margin: 8px 0 6px;
}

.stat-meta {
  font-size: 12px;
  color: rgba(156, 176, 201, 0.8);
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 24px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.panel-wide {
  grid-column: span 1;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-header h2 {
  font-size: 20px;
  margin-bottom: 6px;
}

.panel-header p {
  font-size: 13px;
  color: var(--muted);
}

.filter-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.filter-form .btn {
  justify-self: start;
}

.table-wrapper {
  border-radius: 16px;
  border: 1px solid rgba(90, 130, 190, 0.25);
  overflow: hidden;
  background: rgba(10, 20, 36, 0.75);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th,
.table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(90, 130, 190, 0.15);
}

.table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  background: rgba(8, 18, 32, 0.7);
}

.table tbody tr:hover {
  background: rgba(30, 60, 100, 0.18);
}

.table .row-details td {
  padding-top: 0;
  border-bottom: 1px solid rgba(90, 130, 190, 0.15);
}

.payload-box {
  background: rgba(8, 16, 28, 0.8);
  border: 1px solid rgba(90, 130, 190, 0.25);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 12px;
  color: var(--muted);
  white-space: pre-wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border: 1px solid transparent;
}

.badge-success {
  color: var(--success);
  border-color: rgba(42, 214, 159, 0.4);
  background: rgba(42, 214, 159, 0.15);
}

.badge-warning {
  color: var(--accent);
  border-color: rgba(42, 169, 255, 0.4);
  background: rgba(42, 169, 255, 0.15);
}

.badge-danger {
  color: var(--danger);
  border-color: rgba(255, 91, 107, 0.4);
  background: rgba(255, 91, 107, 0.15);
}

.monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.hours-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 12px;
}

.hour-card {
  background: rgba(12, 24, 42, 0.85);
  border: 1px solid rgba(90, 130, 190, 0.25);
  border-radius: 14px;
  padding: 10px;
  display: grid;
  gap: 8px;
  text-align: center;
}

.hour-bar {
  height: 80px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(8, 16, 28, 0.6);
  border-radius: 10px;
  padding: 6px;
}

.hour-bar span {
  display: block;
  width: 100%;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px rgba(30, 120, 255, 0.4);
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.resource-card {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(90, 130, 190, 0.25);
  background: rgba(12, 22, 38, 0.85);
  display: grid;
  gap: 6px;
}

.resource-name {
  font-weight: 600;
}

.resource-meta {
  font-size: 12px;
  color: var(--muted);
}

.resource-state {
  justify-self: start;
}

.mono {
  font-family: "JetBrains Mono", "Cascadia Code", "Consolas", monospace;
  font-size: 12px;
}

.search-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

input,
select,
button {
  font-family: inherit;
}

input,
select {
  background: rgba(8, 17, 30, 0.9);
  border: 1px solid rgba(90, 130, 190, 0.45);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  outline: none;
  transition: border var(--transition), box-shadow var(--transition);
}

input:focus,
select:focus {
  border-color: rgba(74, 140, 255, 0.8);
  box-shadow: 0 0 0 3px rgba(74, 140, 255, 0.2);
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 30px;
}

.btn {
  border: none;
  cursor: pointer;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(40, 120, 255, 0.25);
}

.btn:active {
  transform: translateY(0);
  opacity: 0.9;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.btn-secondary {
  background: rgba(38, 74, 128, 0.75);
  color: #e4eeff;
  border: 1px solid rgba(108, 154, 222, 0.5);
}

.btn-ghost {
  background: rgba(16, 32, 52, 0.7);
  color: var(--text);
  border: 1px solid rgba(120, 160, 210, 0.4);
}

.players-grid {
  display: grid;
  gap: 18px;
}

.player-card {
  background: var(--card-strong);
  border: 1px solid rgba(120, 160, 210, 0.35);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.player-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.player-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-small {
  padding: 8px 12px;
  font-size: 12px;
}

.player-name {
  font-size: 18px;
  font-weight: 700;
}

.player-login {
  font-size: 12px;
  color: var(--muted);
}

.status {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.status-online {
  background: rgba(42, 214, 159, 0.18);
  color: var(--success);
  border: 1px solid rgba(42, 214, 159, 0.4);
}

.status-offline {
  background: rgba(255, 91, 107, 0.12);
  color: var(--danger);
  border: 1px solid rgba(255, 91, 107, 0.3);
}

.player-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.player-stats span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.player-stats strong {
  font-size: 16px;
}

.player-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.action-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  align-items: center;
}

.action-form-wide {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.action-form input {
  width: 100%;
}

.action-form button {
  justify-self: end;
}

.action-block {
  background: rgba(8, 18, 32, 0.7);
  border: 1px solid rgba(90, 130, 190, 0.25);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.action-title {
  font-weight: 600;
  font-size: 14px;
}

.action-note {
  font-size: 12px;
  color: var(--muted);
}

.action-hint {
  font-size: 12px;
  color: var(--muted);
}

.action-hint code {
  color: #e6f0ff;
}

.actions-list {
  display: grid;
  gap: 12px;
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: 12px;
  background: rgba(12, 23, 40, 0.8);
  border: 1px solid rgba(90, 130, 190, 0.25);
}

.action-title {
  font-weight: 600;
}

.action-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.action-state {
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.action-state-pending {
  color: var(--accent);
}

.action-state-processed {
  color: var(--success);
}

.action-state-failed {
  color: var(--danger);
}

.action-value {
  font-weight: 600;
  color: var(--accent-3);
}

.template-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.template-label {
  font-weight: 600;
}

.online-list {
  display: grid;
  gap: 10px;
  max-height: 340px;
  overflow: auto;
  padding-right: 4px;
}

.online-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(10, 20, 36, 0.8);
  border: 1px solid rgba(90, 130, 190, 0.2);
}

.online-name {
  font-weight: 600;
}

.online-meta {
  font-size: 12px;
  color: var(--muted);
}

.online-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.panel-divider {
  height: 1px;
  background: rgba(90, 130, 190, 0.2);
  margin: 18px 0;
}

.resource-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.suspicious-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.suspicious-card {
  background: rgba(10, 20, 36, 0.75);
  border: 1px solid rgba(90, 130, 190, 0.2);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.suspicious-card h3 {
  font-size: 15px;
}

.ideas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.idea-card {
  background: rgba(10, 22, 38, 0.85);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(90, 130, 190, 0.2);
}

.idea-card h3 {
  margin-bottom: 6px;
  font-size: 16px;
}

.idea-card p {
  font-size: 13px;
  color: var(--muted);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.profile-card {
  background: rgba(10, 20, 36, 0.8);
  border: 1px solid rgba(90, 130, 190, 0.25);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.profile-wide {
  grid-column: span 2;
}

.profile-card h3 {
  font-size: 16px;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.profile-row span {
  color: var(--muted);
}

.profile-meta {
  font-size: 12px;
  color: var(--muted);
}

.profile-pre {
  background: rgba(6, 12, 22, 0.7);
  border-radius: 10px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.4;
  overflow: auto;
  max-height: 280px;
}

.ban-active {
  color: var(--danger);
}

.ban-expired {
  color: var(--muted);
}

.ban-clean {
  color: var(--success);
}

.flash {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 10px;
}

.flash-error {
  background: rgba(255, 91, 107, 0.12);
  border: 1px solid rgba(255, 91, 107, 0.35);
  color: var(--danger);
}

.flash-success {
  background: rgba(42, 214, 159, 0.15);
  border: 1px solid rgba(42, 214, 159, 0.4);
  color: var(--success);
}

.flash-info {
  background: rgba(42, 169, 255, 0.15);
  border: 1px solid rgba(42, 169, 255, 0.35);
  color: var(--accent);
}

.empty-state {
  padding: 16px;
  border-radius: 12px;
  border: 1px dashed rgba(90, 130, 190, 0.5);
  color: var(--muted);
}

.auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.auth-shell {
  width: min(420px, 90vw);
}

.auth-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.auth-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.auth-header h1 {
  font-size: 22px;
  margin-bottom: 4px;
}

.auth-header p {
  font-size: 13px;
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.auth-note {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .profile-wide {
    grid-column: span 1;
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
  }

  .topbar-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .main {
    padding: 24px 18px 60px;
  }

  .search-form {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .action-form {
    grid-template-columns: 1fr;
  }
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-form input {
  min-width: 160px;
}
