:root {
  --stk-brand: #3a6ea5;
  --stk-brand-dark: #2f5f8f;
  --stk-brand-light: #5a8fc4;
  --stk-bg: #f0f3f7;
  --stk-text: #222222;
  --stk-muted: #6b7280;
  --stk-card: #ffffff;
  --stk-border: #d5dde5;
  --stk-sidebar-width: 220px;
  --stk-sidebar-right-width: 250px;
  --stk-header-h: 56px;
}

/* ===== LAYOUT ===== */
body {
  background: var(--stk-bg) !important;
  color: var(--stk-text);
  font-family: "Sarabun", system-ui, sans-serif;
  min-height: 100vh;
  margin: 0;
}

.stk-layout {
  min-height: 100vh;
}

/* ===== HEADER ===== */
.stk-header {
  position: sticky;
  top: 0;
  z-index: 300;
  height: var(--stk-header-h);
  background: #16202c;
  border-bottom: 3px solid var(--stk-brand);
}

.stk-header-inner {
  max-width: 1500px;
  height: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stk-header-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  white-space: nowrap;
  padding-right: 1rem;
  border-right: 1px solid rgba(255,255,255,0.12);
}

.stk-header-brand:hover { color: #fff; }

.stk-header-tagline {
  font-size: 0.62rem;
  font-weight: 400;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.04em;
}

.stk-header-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}

.stk-header-nav a {
  color: #aab9cd;
  font-size: 0.85rem;
  text-decoration: none;
  padding: 0.4rem 0.65rem;
  border-radius: 0.3rem;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}

.stk-header-nav a:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.stk-header-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  white-space: nowrap;
}

.stk-header-chip {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #d0dae6;
  font-size: 0.8rem;
}

.stk-header-login {
  background: var(--stk-brand);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border-radius: 0.3rem;
  text-decoration: none;
}

.stk-header-login:hover {
  background: var(--stk-brand-dark);
  color: #fff;
}

.stk-header-logout {
  color: rgba(255,255,255,0.45);
  font-size: 0.78rem;
  text-decoration: none;
}

.stk-header-logout:hover {
  color: #fff;
}

/* ===== BODY (below header) ===== */
.stk-layout-body {
  display: flex;
  min-height: calc(100vh - var(--stk-header-h));
}

/* ===== LEFT SIDEBAR ===== */
.stk-sidebar-left {
  width: var(--stk-sidebar-width);
  min-width: var(--stk-sidebar-width);
  background: #1a2634;
  color: #c8d4e0;
  position: sticky;
  top: var(--stk-header-h);
  height: calc(100vh - var(--stk-header-h));
  overflow-y: auto;
  z-index: 100;
}

/* ---- nav ---- */
.stk-sidebar-nav {
  padding: 0.5rem 0;
}

.stk-nav-section {
  padding: 0.25rem 0;
}

.stk-nav-section + .stk-nav-section {
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 0.4rem;
  padding-top: 0.5rem;
}

.stk-nav-section-title {
  padding: 0.35rem 1rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.3);
}

.stk-nav-item {
  display: block;
  padding: 0.4rem 1rem;
  color: #a8b8cc;
  text-decoration: none;
  font-size: 0.88rem;
  transition: background 0.12s, color 0.12s;
}

.stk-nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

.stk-nav-cta {
  color: #7eb8f0;
  font-weight: 600;
}

.stk-nav-admin {
  color: #f0c060;
}

.stk-badge-pending {
  display: inline-block;
  color: #e74c3c;
  font-weight: 700;
  font-size: 0.85rem;
}

/* ===== DISCORD SIDEBAR CARD ===== */
.stk-discord-section {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--stk-border);
}

.stk-discord-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.stk-discord-icon {
  font-size: 0.85rem;
  font-weight: 700;
  color: #5865F2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stk-discord-text {
  font-size: 0.8rem;
  color: #8ea0b4;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.stk-discord-btn {
  display: block;
  text-align: center;
  padding: 0.4rem 0.75rem;
  background: #5865F2;
  color: #fff;
  border-radius: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}

.stk-discord-btn:hover {
  background: #4752c4;
  color: #fff;
}

/* ===== MAIN AREA ===== */
.stk-main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.stk-content {
  flex: 1;
  max-width: 960px;
}

.stk-footer {
  padding: 0.75rem 1.5rem;
  font-size: 0.8rem;
  color: var(--stk-muted);
  border-top: 1px solid var(--stk-border);
  background: var(--stk-card);
  text-align: center;
}

/* ===== RIGHT SIDEBAR ===== */
.stk-sidebar-right {
  width: var(--stk-sidebar-right-width);
  min-width: var(--stk-sidebar-right-width);
  background: #e9eef4;
  padding: 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-left: 1px solid var(--stk-border);
}

.stk-sidebar-card {
  background: var(--stk-card);
  border: 1px solid var(--stk-border);
  border-radius: 0.45rem;
  padding: 0.75rem;
}

.stk-sidebar-card-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--stk-muted);
  margin-bottom: 0.5rem;
}

.stk-sidebar-char-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--stk-text);
}

.stk-sidebar-char-faction {
  font-size: 0.78rem;
  color: var(--stk-brand);
}

.stk-sidebar-char-money {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1a7a3a;
  margin-top: 0.15rem;
}

.stk-sidebar-link {
  display: block;
  font-size: 0.8rem;
  color: var(--stk-brand);
  text-decoration: none;
  padding: 0.15rem 0;
}

.stk-sidebar-link:hover {
  text-decoration: underline;
}

/* ---- rank lists (right sidebar) ---- */
.stk-rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.stk-rank-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-size: 0.78rem;
  border-bottom: 1px dashed var(--stk-border);
}

.stk-rank-list li:last-child {
  border-bottom: none;
}

.stk-rank-name {
  color: var(--stk-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stk-rank-val {
  color: var(--stk-brand);
  font-weight: 600;
  white-space: nowrap;
}

/* ---- status dot ---- */
.stk-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.stk-status-online {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34,197,94,0.25);
}

/* ===== Bootstrap overrides ===== */
.btn-primary,
.btn-stk {
  background-color: var(--stk-brand);
  border-color: var(--stk-brand);
  color: #fff;
}

.btn-stk:hover,
.btn-primary:hover {
  background-color: var(--stk-brand-dark);
  border-color: var(--stk-brand-dark);
  color: #fff;
}

.text-primary {
  color: var(--stk-brand) !important;
}

/* ===== Cards & utilities ===== */
.hero-panel {
  background: linear-gradient(135deg, #1e3348 0%, #2f5f8f 48%, #5a8fc4 130%) !important;
  color: #fff;
  border-radius: 1rem;
  padding: 2.5rem 1.75rem;
}

.hero-panel .lead { color: rgba(255,255,255,0.85); max-width: 36rem; }

.card-soft {
  background: var(--stk-card);
  border: 1px solid var(--stk-border) !important;
  box-shadow: none !important;
  border-radius: 0.5rem;
}

.table thead th {
  border-bottom-color: var(--stk-border);
}

.stk-market-hero {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--stk-border);
}

.stk-price {
  color: var(--stk-brand);
  font-weight: 700;
}

.stk-listing-card {
  border: 1px solid var(--stk-border);
  border-radius: 0.5rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.stk-listing-card:hover {
  border-color: var(--stk-brand);
  transform: translateY(-2px);
}

.stk-feature-strip a {
  color: inherit;
  text-decoration: none;
}

.stk-feature-strip a:hover .stk-feature-title {
  color: var(--stk-brand);
  text-decoration: underline;
}

.stk-rank-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--stk-border);
}

.stk-rank-table th {
  background: linear-gradient(#4a7eb0, var(--stk-brand));
  color: #fff;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 0.9rem;
}

.stk-rank-table td {
  padding: 0.45rem 0.75rem;
  border-top: 1px solid var(--stk-border);
  font-size: 0.9rem;
}

.stk-rank-table tr:nth-child(even) td {
  background: #eef2f6;
}

.stk-rank-num {
  width: 2.25rem;
  color: var(--stk-muted);
  font-weight: 600;
}
