/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0d0d0d;
  color: #ffffff;
  overflow: auto;
  font-size: 14px;
  line-height: 1.4;
  scrollbar-color: rgba(120, 120, 120, 0.7) rgba(20, 20, 20, 0.9);
  scrollbar-width: thin;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 6vw 12px;
  border-bottom: 1px solid rgba(60, 60, 60, 0.6);
  background: rgba(15, 15, 15, 0.8);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-text h1 {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 2px;
}

.brand-text span {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 400;
}

.user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(80, 80, 80, 0.6);
  background: rgba(35, 35, 35, 0.8);
  font-size: 12px;
  color: #d1d5db;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(80, 80, 80, 0.6);
  object-fit: cover;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  margin-right: 6px;
  font-size: 11px;
}

.shell {
  padding: 18px 6vw 60px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: calc(100vh - 72px);
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 8px 0 2px;
}

.tab {
  flex: 1;
  background: rgba(35, 35, 35, 0.8);
  border: 1px solid rgba(60, 60, 60, 0.4);
  border-radius: 6px;
  color: #9ca3af;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab.active {
  background: rgba(45, 45, 45, 0.9);
  color: #ffffff;
  border-color: rgba(80, 80, 80, 0.6);
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  background: #f97316;
  color: #0d0d0d;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-1px);
}

.tab:hover:not(.active) {
  background: rgba(40, 40, 40, 0.9);
  color: #cccccc;
}

.view {
  display: none;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  flex: 1;
}

.view.active {
  display: flex;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  padding: 12px 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input,
select {
  width: 100%;
  height: 34px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0 10px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(200, 200, 200, 0.9) 50%),
    linear-gradient(135deg, rgba(200, 200, 200, 0.9) 50%, transparent 50%),
    linear-gradient(to right, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08));
  background-position:
    calc(100% - 16px) 14px,
    calc(100% - 11px) 14px,
    calc(100% - 32px) 6px;
  background-size: 5px 5px, 5px 5px, 1px 22px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

select option {
  background: #121212;
  color: #e5e7eb;
}

input::placeholder {
  color: #6b7280;
}

input:focus,
select:focus {
  outline: none;
  border-color: #888888;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 2px rgba(120, 120, 120, 0.3);
}

.btn {
  height: 34px;
  background: rgba(45, 45, 45, 0.9);
  border: 1px solid rgba(60, 60, 60, 0.6);
  border-radius: 6px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn.ghost {
  background: transparent;
  border: 1px solid rgba(80, 80, 80, 0.6);
  color: #d1d5db;
  padding: 6px 12px;
  border-radius: 6px;
}

.btn.ghost:hover {
  background: rgba(45, 45, 45, 0.6);
  border-color: rgba(100, 100, 100, 0.8);
  color: #ffffff;
}

.btn:hover {
  background: rgba(55, 55, 55, 0.9);
  border-color: rgba(80, 80, 80, 0.8);
}

.panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(20, 20, 20, 0.98);
  border: 1px solid rgba(60, 60, 60, 0.6);
  border-radius: 8px;
  overflow: hidden;
  min-height: 0;
}

.panel-head {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(60, 60, 60, 0.6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 15, 15, 0.8);
}

.panel-head h2 {
  font-size: 14px;
  font-weight: 600;
}

.status {
  font-size: 11px;
  color: #9ca3af;
}

.table {
  flex: 1;
  overflow: auto;
  padding: 10px 12px 12px;
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 0;
}

#logsRows,
#globalRows,
#playersRows,
#charactersRows,
#itemsRows,
#auditRows,
#threatRows {
  display: grid;
  gap: 8px;
  align-content: start;
}

.row {
  display: grid;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(40, 40, 40, 0.6);
  border: 1px solid rgba(60, 60, 60, 0.4);
  transition: all 0.2s ease;
  font-size: 12px;
}

.row:not(.header):hover {
  background: rgba(50, 50, 50, 0.8);
  border-color: rgba(80, 80, 80, 0.6);
}

.row.header {
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 12px;
}

.logs-table .row,
.global-table .row,
.audit-table .row {
  grid-template-columns: 150px 80px 1fr 1.6fr 1.1fr 70px 90px;
}


.threats-table .row {
  grid-template-columns: 150px 80px 1fr 1.6fr 1.1fr 70px 110px 90px;
}

.players-table .row {
  grid-template-columns: 1.1fr 1fr 1fr 1fr 1.2fr 1fr 60px 40px;
}

.characters-table .row {
  grid-template-columns: 1.4fr 1fr 1.5fr 1fr 60px;
}

.items-table .row {
  grid-template-columns: 1.2fr 1.2fr 120px 1fr 60px 40px 40px;
}

.news-table .row {
  grid-template-columns: 1.5fr 110px 170px 1fr 60px 60px;
}

.link-btn {
  background: transparent;
  border: none;
  color: #60a5fa;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: 12px;
}

.link-btn:hover {
  text-decoration: underline;
}

.threat-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(220, 38, 38, 0.2);
  color: #f87171;
  border: 1px solid rgba(220, 38, 38, 0.45);
}

.threat-flag.resolved {
  background: rgba(34, 197, 94, 0.16);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.4);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(249, 115, 22, 0.15);
  color: #fdba74;
  border: 1px solid rgba(249, 115, 22, 0.4);
}

.status-chip.resolved {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.35);
}

.action-btn.small {
  padding: 4px 8px;
  font-size: 10px;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 30;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(860px, 96vw);
  background: rgba(20, 20, 20, 0.98);
  border-left: 1px solid rgba(60, 60, 60, 0.6);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.8);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 40;
  display: flex;
  flex-direction: column;
  pointer-events: all;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(480px, 92vw);
  background: rgba(20, 20, 20, 0.98);
  border: 1px solid rgba(60, 60, 60, 0.6);
  border-radius: 8px;
  padding: 24px;
  display: grid;
  gap: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
}

.login-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-hint {
  font-size: 12px;
  color: #9ca3af;
}

.home {
  min-height: 100vh;
  --portal-accent: #1d7ed6;
  --portal-accent-soft: rgba(29, 126, 214, 0.22);
  --portal-bg: #0a0f14;
  background:
    radial-gradient(circle at 10% 0%, rgba(29, 126, 214, 0.14), transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(29, 126, 214, 0.08), transparent 35%),
    var(--portal-bg);
}

.home .top {
  padding: 20px 12px 12px;
  background: rgba(8, 12, 18, 0.85);
  border-bottom-color: rgba(29, 126, 214, 0.25);
}

.admin .top {
  padding: 20px 12px 12px;
}

.top-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.top-quick-links {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.top-quick-link {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 0;
  border: 1px solid rgba(29, 126, 214, 0.38);
  background: rgba(16, 24, 34, 0.92);
  color: #dbeafe;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.top-quick-link:hover {
  background: rgba(24, 34, 46, 0.96);
  border-color: rgba(29, 126, 214, 0.7);
  transform: translateY(-1px);
}

.top-quick-icon-img {
  display: block;
  width: 17px;
  height: 17px;
  object-fit: contain;
  object-position: center;
  margin: auto;
  flex-shrink: 0;
  line-height: 1;
}

.top-profile-frame {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(29, 126, 214, 0.45);
  background: rgba(18, 25, 35, 0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.top-profile-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu-toggle {
  width: 42px;
  height: 42px;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: rgba(16, 24, 34, 0.92);
  border: 1px solid rgba(29, 126, 214, 0.4);
  border-radius: 10px;
  cursor: pointer;
  padding: 0 10px;
}

.menu-toggle:hover {
  background: rgba(24, 34, 46, 0.95);
}

.menu-line {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: #dbeafe;
}

.side-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 45;
}

.side-menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.side-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: min(340px, 88vw);
  height: 100vh;
  background: rgba(10, 16, 24, 0.98);
  border-left: 1px solid rgba(29, 126, 214, 0.35);
  transform: translateX(102%);
  transition: transform 0.18s ease;
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 18px;
  gap: 16px;
}

.side-menu.open {
  transform: translateX(0);
}

.side-menu-head {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(29, 126, 214, 0.35);
  border-radius: 12px;
  background: rgba(19, 28, 39, 0.9);
  padding: 12px;
}

.side-avatar {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(29, 126, 214, 0.45);
}

.side-profile-text {
  display: grid;
  gap: 4px;
}

.side-profile-text strong {
  font-size: 14px;
  font-weight: 600;
}

.side-profile-text span {
  font-size: 12px;
  color: #9ca3af;
}

.side-menu-nav {
  display: grid;
  gap: 8px;
}

.side-link {
  display: flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid rgba(29, 126, 214, 0.3);
  border-radius: 8px;
  background: rgba(17, 25, 35, 0.9);
  color: #e5e7eb;
  font-size: 13px;
  font-weight: 500;
  padding: 0 12px;
  text-decoration: none;
}

.side-link:hover {
  background: rgba(24, 36, 50, 0.95);
}

.side-menu-actions {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.home-shell {
  min-height: calc(100vh - 80px);
  padding: 30px min(4vw, 36px) 48px;
}

.portal-layout {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.portal-hero {
  padding: 4px 2px 8px;
  display: grid;
  gap: 2px;
}

.portal-hero h2 {
  font-size: clamp(40px, 8vw, 78px);
  line-height: 1;
  letter-spacing: 0.01em;
  color: #f3f8ff;
}

.portal-hero h3 {
  font-size: clamp(18px, 2.6vw, 26px);
  font-weight: 500;
  color: #a8c5e0;
}

.hero-meta-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero-meta-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.home-player-inline {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: #9fb3c8;
}

.home-player-inline span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.home-player-inline strong {
  font-size: 18px;
  font-weight: 700;
  color: #e7f0fb;
}

.portal-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  align-items: start;
}

.portal-media,
.portal-side {
  display: grid;
  gap: 12px;
}

.media-main,
.media-thumb,
.journey-card,
.home-news {
  border: 1px solid rgba(29, 126, 214, 0.24);
  border-radius: 12px;
  background: rgba(10, 16, 24, 0.9);
}

.media-main {
  min-height: 260px;
  padding: 14px;
}

.media-thumbs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.media-thumb {
  min-height: 110px;
  padding: 10px;
}

.media-placeholder {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.media-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(29, 126, 214, 0.14), transparent 45%),
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 6px,
      transparent 6px,
      transparent 12px
    );
}

.media-placeholder span {
  position: relative;
  z-index: 1;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 500;
}

.journey-card {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.journey-card h3,
.home-news-head h3 {
  font-size: 15px;
  font-weight: 700;
  color: #e2e8f0;
}

.journey-list {
  list-style: none;
  display: grid;
  gap: 10px;
}

.journey-list li {
  border-left: 2px solid rgba(29, 126, 214, 0.65);
  padding-left: 10px;
  display: grid;
  gap: 2px;
}

.journey-list li span {
  font-size: 13px;
  font-weight: 600;
  color: #cfe4ff;
}

.journey-list li small {
  font-size: 12px;
  color: #94a3b8;
}

.home-card {
  width: min(700px, 95vw);
  background: rgba(20, 20, 20, 0.98);
  border: 1px solid rgba(60, 60, 60, 0.6);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
  padding: 24px;
  display: grid;
  gap: 12px;
}

.home-card h2 {
  font-size: 24px;
  font-weight: 700;
}

.home-card p {
  color: #d1d5db;
  font-size: 14px;
}

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home-news {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.home-news-head h3 {
  font-size: 15px;
  font-weight: 600;
}

.home-news-list {
  display: grid;
  gap: 10px;
}

.home .home-news-list .news-card {
  border: 1px solid rgba(29, 126, 214, 0.3);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(12, 20, 30, 0.95), rgba(10, 16, 24, 0.92));
  padding: 12px;
  display: grid;
  gap: 7px;
}

.home .home-news-list .news-card h4 {
  font-size: 14px;
  font-weight: 700;
  color: #e6f0fb;
}

.home .home-news-list .news-card p {
  margin: 0;
  color: #c8d7e8;
  white-space: pre-wrap;
  line-height: 1.45;
}

.home .home-news-list .news-meta {
  font-size: 11px;
  color: #8fa7c0;
}

.news-card {
  border: 1px solid rgba(80, 80, 80, 0.6);
  border-radius: 8px;
  background: rgba(24, 24, 24, 0.92);
  padding: 12px;
  display: grid;
  gap: 6px;
}

.news-card h4 {
  font-size: 14px;
  font-weight: 600;
}

.news-card p {
  margin: 0;
  color: #d1d5db;
  white-space: pre-wrap;
}

.news-meta {
  font-size: 11px;
  color: #9ca3af;
}

.news-editor-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.news-field-wide {
  grid-column: 1 / -1;
}

.news-inline-field {
  max-width: 130px;
}

.news-inline-field input[type='checkbox'] {
  width: 18px;
  height: 18px;
}

.news-textarea {
  min-height: 140px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  padding: 10px;
  resize: vertical;
}

.news-textarea:focus {
  outline: none;
  border-color: #888888;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 2px rgba(120, 120, 120, 0.3);
}

.muted {
  color: #9ca3af;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.stat-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(29, 126, 214, 0.3);
  background: rgba(16, 24, 35, 0.92);
}

.stat-label {
  color: #9ca3af;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  color: #dbeafe;
  font-size: 18px;
  font-weight: 700;
}

.portal-primary {
  background: rgba(29, 126, 214, 0.2);
  border-color: rgba(29, 126, 214, 0.55);
  color: #dbeafe;
}

.portal-primary:hover {
  background: rgba(29, 126, 214, 0.28);
  border-color: rgba(29, 126, 214, 0.75);
}

.home-note {
  font-size: 12px;
  color: #9ca3af;
}

.home-warning {
  font-size: 12px;
  color: #fca5a5;
  background: rgba(127, 29, 29, 0.25);
  border: 1px solid rgba(248, 113, 113, 0.4);
  border-radius: 8px;
  padding: 10px 12px;
}

@media (max-width: 980px) {
  .portal-grid {
    grid-template-columns: 1fr;
  }

  .media-main {
    min-height: 220px;
  }

  .hero-meta-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-meta-right {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .media-thumbs {
    grid-template-columns: 1fr;
  }

  .media-thumb {
    min-height: 90px;
  }
}

.drawer.open {
  transform: translateX(0);
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer-head {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(60, 60, 60, 0.6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 15, 15, 0.8);
}

.drawer-title {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
}

.drawer-close {
  width: 28px;
  height: 28px;
  background: rgba(50, 50, 50, 0.65);
  border: 1px solid rgba(90, 90, 90, 0.7);
  border-radius: 6px;
  color: #e5e7eb;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 12px;
}

.drawer-close:hover {
  background: rgba(70, 70, 70, 0.8);
  border-color: rgba(120, 120, 120, 0.9);
}

.drawer-body {
  padding: 18px;
  overflow: auto;
  display: grid;
  gap: 14px;
}

.drawer-body .table {
  overflow-x: auto;
  flex: 0 0 auto;
}

.drawer-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.drawer-card {
  background: rgba(24, 24, 24, 0.92);
  border: 1px solid rgba(60, 60, 60, 0.6);
  border-radius: 12px;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.drawer-card-title {
  font-size: 16px;
  font-weight: 600;
}

.drawer-card-sub {
  font-size: 12px;
  color: #9ca3af;
}

.drawer-card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(80, 80, 80, 0.6);
  border-radius: 6px;
  font-size: 11px;
  color: #d1d5db;
}

.detail-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.action-btn {
  padding: 6px 10px;
  background: rgba(45, 45, 45, 0.9);
  border: 1px solid rgba(60, 60, 60, 0.6);
  border-radius: 6px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: rgba(55, 55, 55, 0.9);
  border-color: rgba(80, 80, 80, 0.8);
}

.mini-table {
  padding: 10px 0 0;
  background: transparent;
  border: none;
}

.mini-table .row {
  font-size: 12px;
  min-width: 640px;
}

.inventory-group {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.inventory-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #9ca3af;
}

.inventory-table .row {
  grid-template-columns: 60px 1.4fr 80px 2fr;
}

.character-combat-table .row {
  grid-template-columns: 160px 90px 80px 1fr 1fr 1fr 100px;
}

.character-combat-table {
  max-height: 560px;
  overflow-y: auto;
}

.vehicle-list {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.vehicle-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 20, 22, 0.7);
}

.vehicle-info {
  display: grid;
  gap: 4px;
}

.vehicle-name {
  font-weight: 600;
  font-size: 14px;
}

.vehicle-meta {
  font-size: 12px;
  color: #9ca3af;
}

.vehicle-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
  align-content: start;
}

.vehicle-inventory {
  grid-column: 1 / -1;
  padding-top: 8px;
}

.vehicle-inventory.hidden {
  display: none;
}

.logs-table .row > div:nth-child(4),
.audit-table .row > div:nth-child(4),
.mini-table .row > div:nth-child(4) {
  white-space: nowrap;
}

.section-title {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.section-title::before {
  content: '';
  width: 3px;
  height: 12px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-radius: 2px;
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}

.kv {
  display: grid;
  gap: 9px;
}

.kv-row {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 12px;
  font-size: 12px;
  align-items: start;
}

.kv-row span {
  color: #9ca3af;
  font-weight: 500;
}

pre.json {
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(35, 35, 35, 0.8);
  border: 1px solid rgba(60, 60, 60, 0.4);
  padding: 10px;
  border-radius: 6px;
  font-size: 11px;
  color: #d1d5db;
}

.spoiler {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.02em;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.65);
  border: 1px dashed rgba(255, 255, 255, 0.25);
  cursor: pointer;
  user-select: none;
}

.spoiler.revealed {
  background: rgba(255, 186, 90, 0.12);
  color: #ffffff;
  border-style: solid;
  cursor: default;
}

.character-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.character-btn {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(18, 20, 22, 0.7);
  color: #ffffff;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.character-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 186, 90, 0.45);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.25);
}

.character-btn.active {
  background: rgba(42, 74, 116, 0.35);
  border-color: rgba(96, 165, 250, 0.65);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.25);
}

.character-name {
  font-weight: 600;
  font-size: 14px;
}

.character-sub {
  font-size: 12px;
  color: #9ca3af;
}

.character-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.character-summary {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(18, 20, 22, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.character-summary .character-name {
  font-size: 16px;
}

.character-meta {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 6px;
}

@media (max-width: 900px) {
  .drawer {
    width: 100vw;
  }

  .drawer-body {
    padding: 14px;
  }

  .kv-row {
    grid-template-columns: 110px 1fr;
    gap: 8px;
  }

  .character-list {
    grid-template-columns: 1fr;
  }
}

/* Custom scrollbars */
body::-webkit-scrollbar,
.table::-webkit-scrollbar,
.drawer-body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

body::-webkit-scrollbar-track,
.table::-webkit-scrollbar-track,
.drawer-body::-webkit-scrollbar-track {
  background: rgba(20, 20, 20, 0.85);
  border-radius: 6px;
}

body::-webkit-scrollbar-thumb,
.table::-webkit-scrollbar-thumb,
.drawer-body::-webkit-scrollbar-thumb {
  background: rgba(120, 120, 120, 0.75);
  border-radius: 6px;
  border: 1px solid rgba(60, 60, 60, 0.7);
}

body::-webkit-scrollbar-thumb:hover,
.table::-webkit-scrollbar-thumb:hover,
.drawer-body::-webkit-scrollbar-thumb:hover {
  background: rgba(150, 150, 150, 0.85);
}

.login-wrapper {
  justify-content: center;
}

.login-panel {
  width: min(460px, 92vw);
  height: auto;
}

.login-body {
  padding: 20px;
  display: grid;
  gap: 12px;
  color: #d1d5db;
}

.login-hint {
  font-size: 12px;
  color: #9ca3af;
}

@media (max-width: 1024px) {
  .row {
    grid-template-columns: 1fr 1fr;
  }

  .row.header {
    display: none;
  }
}

.team-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(29, 126, 214, 0.12), transparent 38%),
    radial-gradient(circle at 80% 20%, rgba(29, 126, 214, 0.06), transparent 34%),
    #080d13;
}

.team-page .top {
  padding: 20px 12px 12px;
  background: rgba(8, 12, 18, 0.88);
  border-bottom-color: rgba(29, 126, 214, 0.22);
}

.team-shell {
  min-height: calc(100vh - 80px);
  padding: 34px min(4vw, 36px) 52px;
}

.team-layout {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  gap: 22px;
}

.team-hero {
  text-align: center;
  display: grid;
  gap: 10px;
}

.team-hero h2 {
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.05;
  color: #f5f9ff;
}

.team-hero h2 span {
  color: #55a8f2;
}

.team-hero p {
  max-width: 680px;
  margin: 0 auto;
  color: #9eb5cc;
  font-size: 16px;
}

.team-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.team-card {
  border: 1px solid rgba(29, 126, 214, 0.22);
  border-radius: 14px;
  background: rgba(8, 14, 20, 0.86);
  padding: 16px 14px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
}

.team-card:hover {
  border-color: rgba(29, 126, 214, 0.42);
  background: rgba(11, 18, 26, 0.9);
}

.team-avatar {
  width: 82px;
  height: 82px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(29, 126, 214, 0.35);
}

.team-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: #edf4ff;
}

.team-card p {
  margin-top: -2px;
  font-size: 12px;
  color: #9bb0c5;
}

.team-links {
  margin-top: 2px;
  display: inline-flex;
  gap: 8px;
}

.team-link {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(29, 126, 214, 0.4);
  background: rgba(15, 26, 36, 0.9);
}

.team-link:hover {
  border-color: rgba(29, 126, 214, 0.68);
  background: rgba(21, 34, 47, 0.95);
}

.team-link-icon {
  width: 13px;
  height: 13px;
  display: block;
  object-fit: contain;
}

@media (max-width: 1080px) {
  .team-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-shell {
    padding-top: 24px;
  }
}

@media (max-width: 520px) {
  .team-grid {
    grid-template-columns: 1fr;
  }
}

.characters-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(29, 126, 214, 0.12), transparent 38%),
    radial-gradient(circle at 80% 20%, rgba(29, 126, 214, 0.06), transparent 34%),
    #080d13;
}

.characters-page .top {
  padding: 20px 12px 12px;
  background: rgba(8, 12, 18, 0.88);
  border-bottom-color: rgba(29, 126, 214, 0.22);
}

.characters-shell {
  min-height: calc(100vh - 80px);
  padding: 28px min(4vw, 36px) 48px;
}

.characters-auth-gate {
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
}

.characters-login-card {
  width: min(500px, 94vw);
  border: 1px solid rgba(29, 126, 214, 0.32);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(16, 24, 36, 0.96), rgba(10, 16, 24, 0.98));
  padding: 20px;
  display: grid;
  gap: 10px;
  text-align: center;
}

.characters-login-card h2 {
  font-size: 24px;
  color: #eff6ff;
}

.characters-login-card p {
  color: #9eb5cc;
  font-size: 14px;
}

.characters-login-card .btn {
  width: 100%;
}

.characters-content {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.characters-head {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(29, 126, 214, 0.22);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(12, 20, 31, 0.92), rgba(9, 15, 23, 0.94));
}

.characters-head h2 {
  font-size: 28px;
  color: #f5f9ff;
}

.characters-head p {
  color: #9eb5cc;
  font-size: 13px;
}

.characters-head-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.characters-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(29, 126, 214, 0.38);
  background: rgba(14, 29, 43, 0.84);
  color: #d7e8fa;
  font-size: 12px;
  font-weight: 600;
}

.characters-chip.ghost {
  border-color: rgba(96, 125, 152, 0.45);
  background: rgba(14, 21, 32, 0.75);
  color: #a6bed6;
}

.characters-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.character-card {
  border: 1px solid rgba(29, 126, 214, 0.28);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(13, 21, 33, 0.93), rgba(9, 16, 25, 0.94));
  padding: 14px 14px 12px;
  display: grid;
  gap: 12px;
  box-shadow: 0 8px 20px rgba(2, 7, 13, 0.36);
}

.character-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.character-card h3 {
  font-size: 17px;
  color: #e7f0fb;
  line-height: 1.2;
}

.character-heading {
  display: grid;
  gap: 2px;
}

.character-heading p {
  font-size: 12px;
  color: #96b1ca;
  word-break: break-word;
}

.character-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.character-details > div {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(29, 126, 214, 0.18);
  border-radius: 9px;
  background: rgba(8, 14, 22, 0.74);
  padding: 8px;
}

.character-card dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8eacc9;
}

.character-card dd {
  margin: 0;
  color: #dceafa;
  word-break: break-word;
  font-size: 13px;
}

.character-footer {
  margin-top: 2px;
  border-top: 1px solid rgba(29, 126, 214, 0.17);
  padding-top: 8px;
}

.character-last-seen {
  display: inline-flex;
  font-size: 12px;
  color: #9db7cf;
}

.character-card.empty {
  text-align: center;
  justify-items: center;
  padding: 20px;
}

.character-card.empty p {
  font-size: 13px;
  color: #9eb5cc;
  max-width: 44ch;
}

@media (max-width: 780px) {
  .characters-shell {
    padding: 22px 14px 34px;
  }

  .characters-head h2 {
    font-size: 24px;
  }

  .characters-grid {
    grid-template-columns: 1fr;
  }

  .character-details {
    grid-template-columns: 1fr;
  }
}
