:root {
  --rdjl-brand-950: #04112b;
  --rdjl-brand-900: #06204a;
  --rdjl-brand-800: #0a2f66;
  --rdjl-brand-700: #0a3e8a;
  --rdjl-brand-600: #0f5ec7;
  --rdjl-brand-500: #1da4ff;
  --rdjl-accent: #21c2ff;
  --rdjl-text: #0b1a36;
  --rdjl-muted: #51627f;
  --rdjl-border: #cddaf0;
  --rdjl-surface: #f3f8ff;
  --rdjl-surface-strong: #ffffff;
  --rdjl-card-radius: 18px;
}

/* Global page background */
body.rdjl-body {
  min-height: 100vh;
  background:
    radial-gradient(1200px circle at 20% 10%, rgba(33,194,255,.20), transparent 55%),
    radial-gradient(900px circle at 80% 30%, rgba(29,164,255,.18), transparent 50%),
    linear-gradient(180deg, var(--rdjl-brand-900), var(--rdjl-brand-950) 70%);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

/* Optional content wrapper */
.rdjl-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 16px 40px;
}

/* Nav wrapper: same width as rdjl-container but no vertical padding */
.rdjl-container-nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 1400px) {
  .rdjl-container-nav { max-width: 1320px; }
}

@media (min-width: 1400px) {
  .rdjl-container { max-width: 1320px; }
}

/* Consistent page heading */
.rdjl-page-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  color: #f8fafc;
  text-shadow: 0 1px 0 rgba(0,0,0,.25);
}

.rdjl-page-subtitle {
  color: rgba(226, 232, 240, 0.95);
}

/* Ensure top-level page headings remain readable on dark page backgrounds. */
.rdjl-body .rdjl-container > h1,
.rdjl-body .rdjl-container > h2,
.rdjl-body .rdjl-container > h3 {
  color: #f8fafc;
}

.rdjl-body .rdjl-container > .mb-3 > .text-muted,
.rdjl-body .rdjl-container > .mb-4 > .text-muted {
  color: rgba(226, 232, 240, 0.92) !important;
}

/* Unified card styling */
.rdjl-card {
  background: rgba(255,255,255,.98);
  border-radius: var(--rdjl-card-radius);
  box-shadow: 0 14px 40px rgba(0,0,0,.15);
  border: 1px solid rgba(255,255,255,.55);
}

/* Mobile-friendly tables (opt-in): add class="rdjl-table-mobile" */
@media (max-width: 768px) {
  table.rdjl-table-mobile thead { display: none; }
  table.rdjl-table-mobile,
  table.rdjl-table-mobile tbody,
  table.rdjl-table-mobile tr,
  table.rdjl-table-mobile td { display: block; width: 100%; }

  table.rdjl-table-mobile tr {
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(17,24,39,0.08);
    border-radius: 16px;
    padding: 10px 10px;
    margin: 0 0 12px;
    box-shadow: 0 10px 24px rgba(17,24,39,0.06);
  }
  table.rdjl-table-mobile td {
    border: 0 !important;
    padding: 8px 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  table.rdjl-table-mobile td::before {
    content: attr(data-label);
    font-weight: 600;
    color: rgba(17,24,39,0.65);
  }
  table.rdjl-table-mobile td:last-child { justify-content: flex-end; }
}

/* Brand header / navbar */
.navbar.rdjl-nav {
  background: rgba(255,255,255,.12) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.18);
}
.navbar.rdjl-nav .navbar-brand,
.navbar.rdjl-nav .nav-link {
  color: #fff !important;
}
.navbar.rdjl-nav .nav-link.active,
.navbar.rdjl-nav .nav-link:hover {
  text-decoration: underline;
}

/* Modern admin navbar (used by admin_nav.php) */
.rdjl-adminbar {
  background: linear-gradient(110deg, rgba(6,32,74,.94), rgba(10,62,138,.90));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(163,201,255,.35);
  box-shadow: 0 10px 26px rgba(2,14,37,.34);
}

.rdjl-adminbar .rdjl-container-nav,
.rdjl-adminbar .rdjl-adminbar-inner {
  padding-top: 10px;
  padding-bottom: 10px;
}

.rdjl-adminbar .rdjl-adminbar-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.rdjl-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.rdjl-brand:hover,
.rdjl-brand:focus {
  color: #fff;
  text-decoration: none;
}

.rdjl-brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #3b82f6, #0ea5e9);
  border: 1px solid rgba(255,255,255,.40);
  box-shadow: 0 10px 22px rgba(0,0,0,.25);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .05em;
}

.rdjl-brand-logo {
  max-width: 180px;
  max-height: 40px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(191, 214, 246, .95);
  filter: drop-shadow(0 3px 8px rgba(0,0,0,.20));
}

.rdjl-brand-copy {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.05;
}

.rdjl-brand-text {
  color: #f8fafc;
  font-size: 1.02rem;
  font-weight: 800;
}

.rdjl-brand-sub {
  color: rgba(226,240,255,.88);
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .10em;
  margin-top: 2px;
}

.rdjl-nav-collapse {
  margin-left: auto;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}

.rdjl-env-banner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(250, 204, 21, .95);
  background: linear-gradient(135deg, rgba(250, 204, 21, .95), rgba(245, 158, 11, .96));
  color: #3f2a00;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1;
  padding: .36rem .62rem;
  box-shadow: 0 6px 16px rgba(120, 53, 15, .30);
  white-space: nowrap;
}

.rdjl-nav-pills {
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.rdjl-navpills .rdjl-pill,
.rdjl-nav-pills .rdjl-pill {
  color: rgba(241,248,255,.96) !important;
  border-radius: 999px;
  padding: 8px 13px;
  line-height: 1;
  border: 1px solid rgba(173,206,255,.34);
  background: rgba(255,255,255,.12);
  font-weight: 650;
  font-size: .86rem;
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
}

.rdjl-navpills .rdjl-pill:hover,
.rdjl-nav-pills .rdjl-pill:hover {
  background: rgba(255,255,255,.20);
  border-color: rgba(209,228,255,.50);
  transform: translateY(-1px);
}

.rdjl-navpills .rdjl-pill.active,
.rdjl-nav-pills .rdjl-pill.active {
  color: #082b61 !important;
  background: #f3f8ff;
  border-color: #d7e7ff;
  font-weight: 700;
}

.rdjl-nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-left: auto;
  gap: .45rem;
}

.rdjl-admin-user {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(191,214,246,.50);
  background: rgba(255,255,255,.16);
  color: rgba(241,248,255,.97);
  font-size: .75rem;
  font-weight: 700;
  padding: .37rem .72rem;
  line-height: 1;
}

.rdjl-nav-toggle {
  border: 1px solid rgba(191,214,246,.56);
  border-radius: 10px;
  padding: .28rem .50rem;
  box-shadow: none;
}

.rdjl-nav-toggle:focus {
  box-shadow: 0 0 0 .2rem rgba(148,197,255,.25);
}

.rdjl-nav-toggle .navbar-toggler-icon {
  filter: invert(1) brightness(1.85);
}

.rdjl-admin-actions .btn,
.rdjl-nav-actions .btn,
.rdjl-btn {
  border-radius: 999px;
  padding: 7px 13px;
  border: 1px solid rgba(191,214,246,.42);
  background: rgba(255,255,255,.18);
  color: #fff;
  font-weight: 700;
  font-size: .80rem;
}

.rdjl-admin-actions .btn:hover,
.rdjl-nav-actions .btn:hover,
.rdjl-btn:hover {
  background: rgba(255,255,255,.26);
  color: #fff;
}

.rdjl-btn.rdjl-btn-ghost {
  border-color: rgba(191,214,246,.55);
  background: rgba(255,255,255,.20);
  color: #fff;
}

.rdjl-btn.rdjl-btn-ghost:hover {
  background: rgba(255,255,255,.25);
}

.rdjl-btn.rdjl-btn-current {
  border-color: rgba(220,236,255,.86);
  background: rgba(255,255,255,.34);
}

.rdjl-btn.rdjl-btn-danger {
  border-color: rgba(254,111,132,.70);
  background: rgba(244,63,94,.32);
  color: #fff;
}

.rdjl-btn.rdjl-btn-danger:hover {
  background: rgba(244,63,94,.42);
}

@media (max-width: 991.98px) {
  .rdjl-adminbar .rdjl-adminbar-inner {
    align-items: center;
  }

  .rdjl-nav-collapse {
    margin-left: 0;
    margin-top: 10px;
    width: 100%;
    background: rgba(6, 32, 74, .65);
    border: 1px solid rgba(173,206,255,.34);
    border-radius: 14px;
    padding: 10px;
  }

  .rdjl-nav-pills {
    width: 100%;
    gap: 6px;
    margin-bottom: 8px !important;
  }

  .rdjl-env-banner {
    align-self: flex-start;
    margin-bottom: 4px;
  }

  .rdjl-nav-pills .nav-item {
    flex: 1 1 calc(50% - 6px);
    min-width: 150px;
  }

  .rdjl-nav-pills .rdjl-pill {
    text-align: center;
  }

  .rdjl-nav-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,.14);
  }

  .rdjl-admin-user {
    order: 5;
    width: 100%;
    justify-content: center;
    margin-top: 2px;
  }

  .rdjl-nav-actions .btn,
  .rdjl-btn {
    padding: 6px 10px;
    font-size: .76rem;
  }
}

/* Buttons: keep bootstrap, but slightly rounder */
.btn { border-radius: 12px; }

/* Footer version */
.rdjl-footer {
  color: rgba(255,255,255,.9);
  font-size: 12px;
}

/* Make bootstrap cards match theme if used */
.card.rdjl-card,
.card.rdjl-card .card-body {
  border-radius: var(--rdjl-card-radius);
}

/* ===== Elite polish updates ===== */
.portal-brand{display:flex;justify-content:center;margin-bottom:10px;}
.portal-logo{height:40px;width:auto;filter:drop-shadow(0 10px 25px rgba(0,0,0,.35));}

.dash-logo{height:34px;width:auto;filter:drop-shadow(0 10px 25px rgba(0,0,0,.35));}

/* Make cards/tables feel more premium */
.dash-card, .portal-card{
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.table{
  margin-bottom:0;
}
.table thead th{
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.06em;
  font-size:.72rem;
  color: rgba(255,255,255,.75);
  background: rgba(255,255,255,.06);
  border-bottom:1px solid rgba(255,255,255,.12);
}
.table tbody td{
  border-top:1px solid rgba(255,255,255,.08);
}

.btn-primary{
  border:0;
  background: linear-gradient(135deg, rgba(59,130,246,1), rgba(14,165,233,1));
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
}
.btn-primary:hover{filter:brightness(1.05);}

.badge-soft{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.85);
  font-size:.8rem;
}
