:root {
  --rj-ink: #0b1c2c;
  --rj-navy: #14324d;
  --rj-steel: #1f4b6e;
  --rj-mist: #e8eef4;
  --rj-cloud: #f3f6f9;
  --rj-amber: #e8a317;
  --rj-amber-deep: #c4840c;
  --rj-teal: #1aa6a0;
  --rj-text: #152433;
  --rj-muted: #5c6f82;
  --rj-border: rgba(20, 50, 77, 0.12);
  --rj-shadow: 0 10px 30px rgba(11, 28, 44, 0.12);
  --rj-shadow-lg: 0 18px 50px rgba(11, 28, 44, 0.18);
  --rj-radius: 1rem;
  --rj-font-display: "Sora", sans-serif;
  --rj-font-body: "Figtree", sans-serif;
}

html {
  font-size: 15px;
  height: 100%;
}

@media (min-width: 768px) {
  html { font-size: 16px; }
}

body {
  min-height: 100%;
  margin: 0;
  font-family: var(--rj-font-body);
  color: var(--rj-text);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(26, 166, 160, 0.12), transparent 55%),
    radial-gradient(900px 480px at 100% 0%, rgba(232, 163, 23, 0.14), transparent 50%),
    linear-gradient(165deg, #f7fafc 0%, #eef3f8 45%, #e7eef5 100%);
  background-attachment: fixed;
}

body.app-shell {
  padding-bottom: 4.5rem;
}

h1, h2, h3, h4, h5, .navbar-brand, .brand-mark, .stat-value, .auth-brand-title {
  font-family: var(--rj-font-display);
  letter-spacing: -0.02em;
}

a { color: var(--rj-steel); }
a:hover { color: var(--rj-ink); }

/* ——— App chrome ——— */
.app-topbar {
  background: linear-gradient(120deg, var(--rj-ink) 0%, var(--rj-navy) 55%, var(--rj-steel) 100%);
  box-shadow: 0 8px 28px rgba(11, 28, 44, 0.28);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 1.75rem;
}

.app-topbar .navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.brand-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 0.2rem;
  background: linear-gradient(135deg, var(--rj-amber), #ffd56a);
  box-shadow: 0 0 0 3px rgba(232, 163, 23, 0.25);
}

.app-topbar .nav-link {
  color: rgba(255, 255, 255, 0.78) !important;
  font-weight: 500;
  border-radius: 0.55rem;
  padding: 0.45rem 0.75rem !important;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.app-topbar .nav-link:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.app-topbar .navbar-text {
  color: rgba(255, 255, 255, 0.65) !important;
  font-size: 0.9rem;
}

.btn-logout {
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 0.55rem;
  padding: 0.35rem 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: var(--rj-amber);
  border-color: var(--rj-amber);
  color: var(--rj-ink);
}

.app-main {
  animation: riseIn 0.45s ease both;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 1rem 0;
  color: var(--rj-muted);
  background: transparent;
  border-top: 1px solid var(--rj-border);
  font-size: 0.9rem;
}

/* ——— Surfaces ——— */
.surface-card,
.card.border-0.shadow-sm,
.card.stat-card {
  border: 1px solid rgba(255, 255, 255, 0.65) !important;
  border-radius: var(--rj-radius) !important;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  box-shadow: var(--rj-shadow) !important;
  overflow: hidden;
}

.card.stat-card {
  position: relative;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.card.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--rj-amber), var(--rj-teal));
}

.card.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--rj-shadow-lg) !important;
}

.stat-card .stat-value {
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--rj-ink);
  line-height: 1.1;
}

.stat-card .text-muted {
  color: var(--rj-muted) !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  font-weight: 600;
}

.page-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-hero h1 {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--rj-ink);
}

.page-hero p {
  margin: 0.35rem 0 0;
  color: var(--rj-muted);
}

.table {
  --bs-table-bg: transparent;
}

.table thead {
  background: linear-gradient(180deg, #edf3f8, #e4ecf4);
}

.table thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rj-muted);
  font-weight: 700;
  border-bottom: 0;
  padding-top: 0.95rem;
  padding-bottom: 0.95rem;
}

.table tbody td {
  vertical-align: middle;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.table-hover tbody tr {
  transition: background 0.15s ease, transform 0.15s ease;
}

.table-hover tbody tr:hover {
  background: rgba(26, 166, 160, 0.06);
}

/* ——— Forms & buttons ——— */
.form-control, .form-select {
  border-radius: 0.7rem;
  border-color: rgba(20, 50, 77, 0.18);
  padding: 0.7rem 0.9rem;
  box-shadow: inset 0 1px 2px rgba(11, 28, 44, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--rj-teal);
  box-shadow: 0 0 0 0.2rem rgba(26, 166, 160, 0.18);
}

.form-label {
  font-weight: 600;
  color: var(--rj-navy);
  margin-bottom: 0.35rem;
}

.btn {
  border-radius: 0.7rem;
  font-weight: 650;
  padding: 0.55rem 1.1rem;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  --bs-btn-bg: var(--rj-ink);
  --bs-btn-border-color: var(--rj-ink);
  --bs-btn-hover-bg: var(--rj-navy);
  --bs-btn-hover-border-color: var(--rj-navy);
  --bs-btn-active-bg: var(--rj-steel);
  --bs-btn-active-border-color: var(--rj-steel);
  box-shadow: 0 8px 20px rgba(11, 28, 44, 0.22);
}

.btn-primary:hover {
  box-shadow: 0 12px 26px rgba(11, 28, 44, 0.28);
}

.btn-accent {
  background: linear-gradient(135deg, var(--rj-amber), #f0bc3d);
  border: 0;
  color: var(--rj-ink);
  box-shadow: 0 10px 24px rgba(232, 163, 23, 0.35);
}

.btn-accent:hover {
  color: var(--rj-ink);
  filter: brightness(1.03);
  box-shadow: 0 14px 30px rgba(232, 163, 23, 0.42);
}

.btn-outline-primary {
  --bs-btn-color: var(--rj-navy);
  --bs-btn-border-color: rgba(20, 50, 77, 0.3);
  --bs-btn-hover-bg: var(--rj-navy);
  --bs-btn-hover-border-color: var(--rj-navy);
  --bs-btn-hover-color: #fff;
  background: rgba(255, 255, 255, 0.7);
}

.btn-outline-secondary {
  background: rgba(255, 255, 255, 0.7);
}

.alert {
  border: 0;
  border-radius: 0.85rem;
  box-shadow: 0 8px 22px rgba(11, 28, 44, 0.08);
}

.alert-success {
  background: linear-gradient(135deg, #e8f8f2, #dff5ec);
  color: #0f5c48;
}

/* ——— Auth screens ——— */
body.auth-body {
  margin: 0;
  min-height: 100vh;
  background: var(--rj-ink);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

@media (max-width: 991.98px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { min-height: 34vh; }
}

.auth-visual {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(11, 28, 44, 0.35), rgba(11, 28, 44, 0.82)),
    linear-gradient(120deg, #0b1c2c 0%, #164063 48%, #0f766e 100%);
  display: flex;
  align-items: flex-end;
  padding: clamp(1.5rem, 4vw, 3.5rem);
}

.auth-visual::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 20% 30%, rgba(232, 163, 23, 0.35), transparent 28%),
    radial-gradient(circle at 80% 20%, rgba(26, 166, 160, 0.3), transparent 32%),
    repeating-linear-gradient(
      -18deg,
      transparent 0 18px,
      rgba(255, 255, 255, 0.03) 18px 19px
    );
  animation: drift 18s linear infinite;
}

.auth-visual::after {
  content: "";
  position: absolute;
  width: 28rem;
  height: 28rem;
  right: -6rem;
  bottom: -8rem;
  border-radius: 40% 60% 55% 45%;
  background: radial-gradient(circle, rgba(232, 163, 23, 0.28), transparent 65%);
  filter: blur(2px);
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-40px, 20px, 0); }
}

.auth-visual-content {
  position: relative;
  z-index: 1;
  max-width: 34rem;
  animation: riseIn 0.7s ease both;
}

.auth-brand-title {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.05;
  margin: 0 0 0.85rem;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.auth-brand-title span {
  color: var(--rj-amber);
}

.auth-brand-copy {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.82);
  margin: 0;
  max-width: 28rem;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  background:
    radial-gradient(700px 300px at 90% 0%, rgba(232, 163, 23, 0.12), transparent 50%),
    linear-gradient(180deg, #f8fafc, #eef3f7);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 1.25rem;
  box-shadow: var(--rj-shadow-lg);
  padding: 2rem 1.75rem;
  animation: riseIn 0.55s ease 0.1s both;
}

.auth-card h1 {
  font-size: 1.55rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--rj-ink);
}

.auth-card .lead-muted {
  color: var(--rj-muted);
  margin-bottom: 1.5rem;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rj-navy);
  background: rgba(26, 166, 160, 0.12);
  border: 1px solid rgba(26, 166, 160, 0.2);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  margin-bottom: 1rem;
}

.login-wrapper {
  max-width: 440px;
  margin: 0 auto;
}
