:root {
  --lrm-navy: #0b2e4f;
  --lrm-navy-2: #123f6b;
  --lrm-gold: #d9a521;
  --lrm-gold-soft: #f5d889;
  --lrm-surface: #f4f6f9;
  --lrm-ink: #1c2733;
  --lrm-muted: #5d6b7a;
  --bs-body-font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --bs-body-color: var(--lrm-ink);
  --bs-body-bg: var(--lrm-surface);
  --bs-link-color: var(--lrm-navy-2);
  --bs-link-color-rgb: 18, 63, 107;
  --bs-link-hover-color: #08233d;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 500px at 100% -10%, rgba(217, 165, 33, 0.12), transparent 60%),
    radial-gradient(900px 420px at 0% 0%, rgba(18, 63, 107, 0.1), transparent 55%),
    var(--lrm-surface);
}

main {
  flex: 1 0 auto;
}

a {
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.navbar-lrm {
  background: linear-gradient(120deg, var(--lrm-navy) 0%, #0a2643 100%);
  box-shadow: 0 2px 14px rgba(6, 24, 44, 0.25);
}

.navbar-lrm .navbar-brand {
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.navbar-lrm .nav-link {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 500;
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
}

.navbar-lrm .nav-link:hover,
.navbar-lrm .nav-link:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.navbar-lrm .nav-link.active {
  color: var(--lrm-navy);
  background: var(--lrm-gold);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px;
}

.brand-title {
  line-height: 1.05;
  font-size: 1.02rem;
}

.brand-subtitle {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--lrm-gold-soft);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  color: #fff;
  background:
    radial-gradient(700px 260px at 85% 0%, rgba(217, 165, 33, 0.35), transparent 65%),
    linear-gradient(135deg, #0b2e4f 0%, #0f3f6b 55%, #14507f 100%);
  padding: clamp(2rem, 5vw, 3.6rem);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.5;
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--lrm-gold-soft);
  border: 1px solid rgba(245, 216, 137, 0.45);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
}

.hero h1 {
  font-weight: 800;
  letter-spacing: -0.5px;
}

.card {
  border: 1px solid rgba(11, 46, 79, 0.08);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(11, 46, 79, 0.06);
}

.card-header {
  background: #fff;
  border-bottom: 1px solid rgba(11, 46, 79, 0.08);
  font-weight: 600;
  border-top-left-radius: 16px !important;
  border-top-right-radius: 16px !important;
}

.stat-card {
  height: 100%;
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(11, 46, 79, 0.08);
  padding: 1.1rem 1.2rem;
  box-shadow: 0 8px 20px rgba(11, 46, 79, 0.05);
}

.stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--lrm-navy);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--lrm-muted);
  font-weight: 600;
}

.stat-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(11, 46, 79, 0.08);
  color: var(--lrm-navy);
  font-size: 1.25rem;
}

.btn-primary {
  --bs-btn-bg: var(--lrm-navy);
  --bs-btn-border-color: var(--lrm-navy);
  --bs-btn-hover-bg: #08233d;
  --bs-btn-hover-border-color: #08233d;
  --bs-btn-active-bg: #061c31;
  --bs-btn-active-border-color: #061c31;
  --bs-btn-disabled-bg: var(--lrm-navy);
  --bs-btn-disabled-border-color: var(--lrm-navy);
}

.btn-outline-primary {
  --bs-btn-color: var(--lrm-navy);
  --bs-btn-border-color: var(--lrm-navy);
  --bs-btn-hover-bg: var(--lrm-navy);
  --bs-btn-hover-border-color: var(--lrm-navy);
  --bs-btn-active-bg: #08233d;
  --bs-btn-active-border-color: #08233d;
}

.btn-gold {
  --bs-btn-color: #1f2a12;
  --bs-btn-bg: var(--lrm-gold);
  --bs-btn-border-color: var(--lrm-gold);
  --bs-btn-hover-bg: #c6931a;
  --bs-btn-hover-border-color: #c6931a;
  --bs-btn-hover-color: #1f2a12;
  --bs-btn-active-bg: #b38517;
  --bs-btn-active-border-color: #b38517;
  --bs-btn-active-color: #1f2a12;
  background: var(--lrm-gold);
  border-color: var(--lrm-gold);
  color: #1f2a12;
  font-weight: 600;
}

.btn-gold:hover,
.btn-gold:focus {
  background: #c6931a;
  border-color: #c6931a;
  color: #1f2a12;
}

.text-gold {
  color: var(--lrm-gold) !important;
}

.bg-navy {
  background: var(--lrm-navy) !important;
}

.badge-status {
  font-weight: 600;
  letter-spacing: 0.2px;
}

.table-lrm {
  --bs-table-border-color: rgba(11, 46, 79, 0.1);
  margin-bottom: 0;
}

.table-lrm thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--lrm-muted);
  background: #f8fafc;
  border-bottom: 1px solid rgba(11, 46, 79, 0.12);
  white-space: nowrap;
}

.table-lrm tbody tr:hover {
  background: rgba(217, 165, 33, 0.07);
}

.position-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  border-radius: 999px;
  font-weight: 700;
  background: rgba(11, 46, 79, 0.08);
  color: var(--lrm-navy);
}

.position-badge.top-1 {
  background: linear-gradient(135deg, #f7d774, #d9a521);
  color: #3b2a00;
}

.position-badge.top-2 {
  background: linear-gradient(135deg, #e6ebf1, #b7c3d0);
  color: #22303d;
}

.position-badge.top-3 {
  background: linear-gradient(135deg, #f0c9a6, #c98a52);
  color: #3a210c;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--lrm-muted);
}

.empty-state i {
  font-size: 2.4rem;
  color: rgba(11, 46, 79, 0.25);
}

.form-label {
  font-weight: 600;
  font-size: 0.88rem;
  color: #33475a;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(18, 63, 107, 0.5);
  box-shadow: 0 0 0 0.2rem rgba(18, 63, 107, 0.12);
}

.auth-card {
  max-width: 560px;
  margin-inline: auto;
}

.auth-card .card-body {
  padding: clamp(1.5rem, 4vw, 2.4rem);
}

.auth-aside {
  background: linear-gradient(150deg, var(--lrm-navy), #123f6b);
  color: #fff;
  border-radius: 20px;
  padding: 2rem;
}

.section-title {
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--lrm-navy);
}

.section-kicker {
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--lrm-gold);
}

.contest-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  color: var(--lrm-muted);
  font-size: 0.9rem;
}

.contest-meta i {
  color: var(--lrm-navy);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid rgba(11, 46, 79, 0.18);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--lrm-navy);
  background: #fff;
}

.diploma-preview {
  background: #fff;
  border: 8px double var(--lrm-navy);
  border-radius: 6px;
  padding: 1rem;
  max-width: 320px;
}

.qr-box img {
  max-width: 180px;
  image-rendering: pixelated;
}

.map {
  height: 380px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(11, 46, 79, 0.12);
}

.chart-wrap {
  position: relative;
  height: 280px;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #e11d48;
  display: inline-block;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(225, 29, 72, 0); }
  100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0); }
}

.footer-lrm {
  background: #071e35;
  color: rgba(255, 255, 255, 0.72);
  padding: 2.4rem 0 1.4rem;
  margin-top: 3rem;
}

.footer-lrm a {
  color: rgba(255, 255, 255, 0.82);
}

.footer-lrm a:hover {
  color: var(--lrm-gold-soft);
}

.footer-lrm h6 {
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.74rem;
}

.sidebar-lrm {
  background: #fff;
  border: 1px solid rgba(11, 46, 79, 0.08);
  border-radius: 16px;
  padding: 0.8rem;
}

.sidebar-lrm .nav-link {
  color: #33475a;
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font-weight: 500;
}

.sidebar-lrm .nav-link:hover {
  background: rgba(11, 46, 79, 0.06);
  text-decoration: none;
}

.sidebar-lrm .nav-link.active {
  background: var(--lrm-navy);
  color: #fff;
}

.code-block {
  background: #0f1c2a;
  color: #d7e3ef;
  border-radius: 12px;
  padding: 1rem;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.85rem;
  overflow-x: auto;
}

.progress-thin {
  height: 8px;
  border-radius: 999px;
}

.table-responsive {
  border-radius: 12px;
}

.sort-link {
  color: inherit;
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  .hero {
    border-radius: 16px;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .table-stack thead {
    display: none;
  }

  .table-stack tbody tr {
    display: block;
    border: 1px solid rgba(11, 46, 79, 0.1);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    padding: 0.4rem 0.6rem;
    background: #fff;
  }

  .table-stack tbody td {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    border: 0;
    padding: 0.35rem 0;
    text-align: right;
  }

  .table-stack tbody td::before {
    content: attr(data-label);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--lrm-muted);
    font-weight: 700;
    text-align: left;
  }
}

.pre-line {
  white-space: pre-line;
  word-break: break-word;
}

.rich-content {
  overflow-x: auto;
  overflow-wrap: break-word;
}

.rich-content > :last-child {
  margin-bottom: 0;
}

.rich-content img {
  max-width: 100%;
  height: auto !important;
}

.rich-content table {
  width: 100%;
  margin-bottom: 1rem;
  border-collapse: collapse;
}

.rich-content th,
.rich-content td {
  padding: 0.4rem 0.6rem;
  border: 1px solid #dee2e6;
}

.rich-content blockquote {
  padding-left: 1rem;
  border-left: 3px solid #d9a521;
  color: #6c757d;
}
