/* =========================================================
   MedCard PSU — UI Design v3
   คณะแพทยศาสตร์ มหาวิทยาลัยสงขลานครินทร์
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Sarabun:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Space+Mono:wght@400;700&display=swap');

/* ---- Design Tokens ---- */
:root {
  /* Brand */
  --psu-blue: #1e3a8a;
  --psu-blue-mid: #2563eb;
  --psu-blue-light: #dbeafe;

  /* Card Type Colors */
  --green-main: #16a34a;
  --green-dark: #15803d;
  --green-light: #dcfce7;
  --green-glow: rgba(22, 163, 74, .30);

  --yellow-main: #f59e0b;
  --yellow-dark: #d97706;
  --yellow-light: #fef9c3;
  --yellow-glow: rgba(245, 158, 11, .30);

  --blue-main: #3b82f6;
  --blue-dark: #2563eb;
  --blue-light: #dbeafe;
  --blue-glow: rgba(59, 130, 246, .30);

  --red-main: #ef4444;
  --red-dark: #dc2626;
  --red-light: #fee2e2;
  --red-glow: rgba(239, 68, 68, .30);

  --purple-main: #8b5cf6;
  --purple-dark: #6d28d9;
  --purple-light: #ede9fe;
  --purple-glow: rgba(139, 92, 246, .30);

  /* Neutrals */
  --white: #ffffff;
  --bg: #f0f4ff;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text-1: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --shadow-sm: rgba(15, 23, 42, .06) 0 2px 8px;
  --shadow-md: rgba(15, 23, 42, .10) 0 8px 32px;

  /* Admin */
  --admin-bg: #0f172a;
  --admin-surface: #1e293b;
  --admin-border: rgba(255, 255, 255, .08);

  /* Status */
  --s-submitted: #f59e0b;
  --s-approved: #16a34a;
  --s-rejected: #ef4444;
  --s-printing: #3b82f6;
  --s-distributed: #15803d;
  --s-editing: #8b5cf6;

  --r-sm: 8px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  --sidebar-w: 256px;
  --font-thai: 'Sarabun', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

/* ---- Reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Sarabun', sans-serif;
  color: var(--text-1);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: inherit;
}

input,
select,
textarea {
  font-family: inherit;
}

/* =========================================================
   ANIMATED BACKGROUND
   ========================================================= */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 55% at 15% -5%, rgba(219, 234, 254, .65) 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 85% 105%, rgba(220, 252, 231, .55) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 50% 50%, rgba(254, 249, 195, .30) 0%, transparent 70%),
    linear-gradient(160deg, #f5f8ff 0%, #f0f4ff 30%, #fafffe 65%, #f9fafb 100%);
  overflow: hidden;
}

.page-bg::before,
.page-bg::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .55;
  animation: blobDrift 22s ease-in-out infinite;
}

.page-bg::before {
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(59, 130, 246, .13) 0%, transparent 70%);
  top: -280px;
  left: -200px;
  animation-delay: 0s;
}

.page-bg::after {
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(22, 163, 74, .10) 0%, transparent 70%);
  bottom: -180px;
  right: -180px;
  animation-delay: -11s;
}

.blob-yellow {
  position: fixed;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  filter: blur(130px);
  opacity: .40;
  background: radial-gradient(circle, rgba(245, 158, 11, .14) 0%, transparent 70%);
  top: 28%;
  right: -130px;
  animation: blobDrift 26s ease-in-out infinite reverse;
  z-index: -1;
}

.blob-red {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .32;
  background: radial-gradient(circle, rgba(239, 68, 68, .11) 0%, transparent 70%);
  bottom: 8%;
  left: 8%;
  animation: blobDrift 19s ease-in-out infinite;
  animation-delay: -5s;
  z-index: -1;
}

.blob-green {
  position: fixed;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .35;
  background: radial-gradient(circle, rgba(22, 163, 74, .13) 0%, transparent 70%);
  top: -80px;
  right: 18%;
  animation: blobDrift 30s ease-in-out infinite;
  animation-delay: -8s;
  z-index: -1;
}

.blob-blue-2 {
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: .28;
  background: radial-gradient(circle, rgba(99, 102, 241, .12) 0%, transparent 70%);
  bottom: 18%;
  right: 6%;
  animation: blobDrift 24s ease-in-out infinite reverse;
  animation-delay: -14s;
  z-index: -1;
}

/* Decorative background rings */
.bg-rings {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.bg-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(99, 102, 241, .06);
  animation: bgRingPulse 12s ease-in-out infinite;
}

.bg-ring.r1 {
  width: 600px;
  height: 600px;
  top: -200px;
  left: -100px;
  animation-delay: 0s;
}

.bg-ring.r2 {
  width: 900px;
  height: 900px;
  top: -350px;
  left: -250px;
  animation-delay: -4s;
  border-color: rgba(22, 163, 74, .04);
}

.bg-ring.r3 {
  width: 500px;
  height: 500px;
  bottom: -150px;
  right: -100px;
  animation-delay: -8s;
  border-color: rgba(245, 158, 11, .05);
}

@keyframes bgRingPulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.05);
    opacity: .5;
  }
}

@keyframes blobDrift {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  25% {
    transform: translate(35px, -45px) scale(1.06);
  }

  50% {
    transform: translate(-25px, 32px) scale(.94);
  }

  75% {
    transform: translate(45px, 22px) scale(1.04);
  }
}

/* Floating dots decoration */
.dots-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(circle, rgba(148, 163, 184, .28) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* =========================================================
   VIEW SYSTEM
   ========================================================= */
.view {
  display: none;
}

.view.active {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  animation: viewFadeIn .4s var(--ease);
}

@keyframes viewFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================================
   HOME — TOP NAV
   ========================================================= */
.home-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 40px;
  height: 70px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226, 232, 240, .7);
  box-shadow: 0 1px 0 rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .04);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.nav-logo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-logo-bg {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: white;
  box-shadow: 0 2px 12px rgba(30, 58, 138, .14), 0 1px 3px rgba(15, 23, 42, .06);
  border: 1px solid rgba(30, 58, 138, .10);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px;
  animation: logoFloat 5s ease-in-out infinite;
  flex-shrink: 0;
}

.nav-logo {
  height: 36px;
  width: auto;
  display: block;
}

@keyframes logoFloat {

  0%,
  100% {
    transform: translateY(0);
    box-shadow: 0 2px 12px rgba(30, 58, 138, .14), 0 1px 3px rgba(15, 23, 42, .06);
  }

  50% {
    transform: translateY(-5px);
    box-shadow: 0 10px 28px rgba(30, 58, 138, .22), 0 4px 10px rgba(15, 23, 42, .08);
  }
}

.nav-brand-text {
  line-height: 1.2;
  min-width: 0;
}

.nav-brand-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--psu-blue);
  letter-spacing: -.2px;
}

.nav-brand-sub {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 400;
}

.btn-admin-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  background: var(--psu-blue);
  color: var(--white);
  border: none;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .2s, transform .2s, box-shadow .2s;
  box-shadow: 0 4px 12px rgba(30, 58, 138, .30);
}

.btn-admin-nav:hover {
  background: #1e40af;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(30, 58, 138, .40);
}

.btn-admin-nav:active {
  transform: translateY(0);
}

.btn-login-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: linear-gradient(135deg, #0f766e, #16a34a);
  color: var(--white);
  border: none;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, filter .2s;
  box-shadow: 0 4px 14px rgba(15, 118, 110, .28);
  white-space: nowrap;
}

.btn-login-nav::before {
  content: "🔑";
}

.btn-login-nav:hover {
  filter: brightness(1.04);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 118, 110, .36);
}

.btn-login-nav:active {
  transform: translateY(0);
}

/* =========================================================
   NAV — USER INFO & LOGOUT
   ========================================================= */
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: 5px 12px 5px 6px;
  backdrop-filter: blur(8px);
}

.nav-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.nav-user-avatar.staff {
  background: var(--green-light);
}

.nav-user-avatar.student {
  background: var(--blue-light);
}

.nav-user-detail {
  line-height: 1.3;
}

.nav-user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  white-space: nowrap;
}

.nav-user-meta {
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav-user-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
  letter-spacing: .3px;
}

.nav-user-badge.staff {
  background: var(--green-light);
  color: var(--green-dark);
}

.nav-user-badge.student {
  background: var(--blue-light);
  color: var(--blue-dark);
}

.nav-user-pos {
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-user-dept {
  font-size: 10px;
  color: var(--text-3);
}

.btn-logout-nav {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, transform .15s;
  flex-shrink: 0;
}

.btn-logout-nav:hover {
  background: var(--red-light);
  border-color: var(--red-main);
  transform: scale(1.1);
}

/* =========================================================
   AUTH ERROR PAGE
   ========================================================= */
.auth-error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.auth-error-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
  padding: 48px 40px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}

.auth-error-icon {
  font-size: 52px;
  margin-bottom: 16px;
}

.auth-error-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 10px;
}

.auth-error-msg {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 28px;
}

.btn-auth-login {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--psu-blue);
  color: #fff;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(30, 58, 138, .30);
  transition: background .2s, transform .2s;
}

.btn-auth-login:hover {
  background: #1e40af;
  transform: translateY(-2px);
}

.auth-error-hint {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-3);
}

/* =========================================================
   HOME — HERO
   ========================================================= */
.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 24px 40px;
  text-align: center;
}

.hero-logo-wrap {
  position: relative;
  margin-bottom: 32px;
  display: inline-block;
}

.hero-logo-bg {
  position: relative;
  z-index: 1;
  width: 136px;
  height: 136px;
  border-radius: 32px;
  background: white;
  box-shadow:
    0 8px 40px rgba(30, 58, 138, .16),
    0 2px 10px rgba(15, 23, 42, .08),
    0 0 0 1px rgba(30, 58, 138, .08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  animation: heroLogoIn .9s var(--ease-spring) both, heroLogoFloat 5s ease-in-out 1.2s infinite;
}

.hero-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

@keyframes heroLogoIn {
  from {
    opacity: 0;
    transform: scale(.72) translateY(24px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes heroLogoFloat {

  0%,
  100% {
    transform: translateY(0);
    box-shadow: 0 8px 40px rgba(30, 58, 138, .16), 0 2px 10px rgba(15, 23, 42, .08), 0 0 0 1px rgba(30, 58, 138, .08);
  }

  50% {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px rgba(30, 58, 138, .26), 0 8px 24px rgba(15, 23, 42, .10), 0 0 0 1px rgba(30, 58, 138, .10);
  }
}

.hero-logo-ring {
  position: absolute;
  inset: -20px;
  border-radius: 44px;
  border: 2px solid rgba(37, 99, 235, .14);
  animation: ringPulse 3.2s ease-out 1.5s infinite;
}

.hero-logo-ring-2 {
  position: absolute;
  inset: -40px;
  border-radius: 56px;
  border: 1.5px solid rgba(37, 99, 235, .07);
  animation: ringPulse 3.2s ease-out 1.9s infinite;
}

@keyframes ringPulse {
  0% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.35);
  }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--psu-blue-light);
  color: var(--psu-blue);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 16px;
  animation: fadeSlideUp .6s var(--ease) .3s both;
}

.hero-title {
  font-size: 40px;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1.15;
  letter-spacing: -.5px;
  margin-bottom: 8px;
  animation: fadeSlideUp .6s var(--ease) .4s both;
}

.hero-title span {
  color: var(--psu-blue-mid);
}

.hero-subtitle {
  font-size: 17px;
  color: var(--text-2);
  line-height: 1.7;
  max-width: 500px;
  margin-bottom: 8px;
  animation: fadeSlideUp .6s var(--ease) .5s both;
}

.hero-university {
  font-size: 14px;
  color: var(--text-3);
  font-weight: 500;
  animation: fadeSlideUp .6s var(--ease) .55s both;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Guide text */
.home-guide {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-3);
  text-align: center;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeSlideUp .6s var(--ease) .6s both;
}

.home-guide::before,
.home-guide::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  max-width: 120px;
}

/* =========================================================
   CARD SELECTION GRID
   ========================================================= */
.home-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 24px 64px;
}

.card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  max-width: 1160px;
  width: 100%;
  justify-content: center;
}

/* Card Tile — Light Pastel Design */
.card-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-xl);
  padding: 32px 28px 26px;
  padding-top: 38px;
  cursor: pointer;
  color: var(--text-1);
  background: var(--white);
  border: 1.5px solid var(--border);
  outline: none;
  overflow: hidden;
  transition: transform .38s var(--ease-spring), box-shadow .35s var(--ease), border-color .25s;
  /* Flex sizing: min 270px, max 380px, fills row evenly */
  flex: 1 1 270px;
  max-width: 380px;
  isolation: isolate;
}

/* Shine sweep */
.card-tile::before {
  content: '';
  position: absolute;
  top: -60%;
  left: -60%;
  width: 60%;
  height: 180%;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .55) 50%, transparent 60%);
  transform: skewX(-15deg);
  transition: left .7s var(--ease);
  pointer-events: none;
}

.card-tile:hover::before {
  left: 130%;
}

/* Top accent bar */
.card-tile::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  pointer-events: none;
}

.card-tile:hover {
  transform: translateY(-10px) scale(1.02);
}

.card-tile:active {
  transform: translateY(-4px) scale(1.00);
  transition-duration: .1s;
}

/* ---- Personnel (Green) ---- */
.card-tile.personnel {
  --tile-accent: #16a34a;
  --tile-accent-soft: rgba(34, 197, 94, .22);
  background: linear-gradient(155deg, #f0fdf4 0%, #ffffff 55%);
  border-color: rgba(22, 163, 74, .20);
  box-shadow: 0 4px 20px rgba(22, 163, 74, .07), 0 1px 4px rgba(15, 23, 42, .05);
}

.card-tile.personnel::after {
  background: linear-gradient(90deg, #16a34a, #4ade80);
}

.card-tile.personnel:hover {
  box-shadow: 0 22px 60px rgba(22, 163, 74, .18), 0 4px 14px rgba(22, 163, 74, .10);
  border-color: rgba(22, 163, 74, .32);
}

.card-tile.personnel .tile-icon-wrap {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  box-shadow: 0 6px 20px rgba(22, 163, 74, .30);
}

.card-tile.personnel .tile-name {
  color: #166534;
}

.card-tile.personnel .tile-action {
  border-top-color: rgba(22, 163, 74, .15);
}

.card-tile.personnel .tile-arrow-circle {
  background: rgba(22, 163, 74, .10);
  color: #16a34a;
  border: 1.5px solid rgba(22, 163, 74, .22);
}

.card-tile.personnel:hover .tile-arrow-circle {
  background: #16a34a;
  color: white;
  border-color: transparent;
}

/* ---- Relative (Yellow) ---- */
.card-tile.relative {
  --tile-accent: #f59e0b;
  --tile-accent-soft: rgba(251, 191, 36, .24);
  background: linear-gradient(155deg, #fffbeb 0%, #ffffff 55%);
  border-color: rgba(245, 158, 11, .20);
  box-shadow: 0 4px 20px rgba(245, 158, 11, .07), 0 1px 4px rgba(15, 23, 42, .05);
}

.card-tile.relative::after {
  background: linear-gradient(90deg, #f59e0b, #fde68a);
}

.card-tile.relative:hover {
  box-shadow: 0 22px 60px rgba(245, 158, 11, .18), 0 4px 14px rgba(245, 158, 11, .10);
  border-color: rgba(245, 158, 11, .35);
}

.card-tile.relative .tile-icon-wrap {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  box-shadow: 0 6px 20px rgba(245, 158, 11, .32);
}

.card-tile.relative .tile-name {
  color: #92400e;
}

.card-tile.relative .tile-action {
  border-top-color: rgba(245, 158, 11, .15);
}

.card-tile.relative .tile-arrow-circle {
  background: rgba(245, 158, 11, .10);
  color: #d97706;
  border: 1.5px solid rgba(245, 158, 11, .22);
}

.card-tile.relative:hover .tile-arrow-circle {
  background: #f59e0b;
  color: white;
  border-color: transparent;
}

/* ---- Student (Blue) ---- */
.card-tile.student {
  --tile-accent: #3b82f6;
  --tile-accent-soft: rgba(96, 165, 250, .24);
  background: linear-gradient(155deg, #eff6ff 0%, #ffffff 55%);
  border-color: rgba(59, 130, 246, .20);
  box-shadow: 0 4px 20px rgba(59, 130, 246, .07), 0 1px 4px rgba(15, 23, 42, .05);
}

.card-tile.student::after {
  background: linear-gradient(90deg, #3b82f6, #93c5fd);
}

.card-tile.student:hover {
  box-shadow: 0 22px 60px rgba(59, 130, 246, .18), 0 4px 14px rgba(59, 130, 246, .10);
  border-color: rgba(59, 130, 246, .32);
}

.card-tile.student .tile-icon-wrap {
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  box-shadow: 0 6px 20px rgba(59, 130, 246, .30);
}

.card-tile.student .tile-name {
  color: #1e40af;
}

.card-tile.student .tile-action {
  border-top-color: rgba(59, 130, 246, .15);
}

.card-tile.student .tile-arrow-circle {
  background: rgba(59, 130, 246, .10);
  color: #3b82f6;
  border: 1.5px solid rgba(59, 130, 246, .22);
}

.card-tile.student:hover .tile-arrow-circle {
  background: #3b82f6;
  color: white;
  border-color: transparent;
}

/* ---- Entrepreneur (Red) ---- */
.card-tile.entrepreneur {
  --tile-accent: #ef4444;
  --tile-accent-soft: rgba(248, 113, 113, .24);
  background: linear-gradient(155deg, #fff1f2 0%, #ffffff 55%);
  border-color: rgba(239, 68, 68, .20);
  box-shadow: 0 4px 20px rgba(239, 68, 68, .07), 0 1px 4px rgba(15, 23, 42, .05);
}

.card-tile.entrepreneur::after {
  background: linear-gradient(90deg, #ef4444, #fca5a5);
}

.card-tile.entrepreneur:hover {
  box-shadow: 0 22px 60px rgba(239, 68, 68, .18), 0 4px 14px rgba(239, 68, 68, .10);
  border-color: rgba(239, 68, 68, .32);
}

.card-tile.entrepreneur .tile-icon-wrap {
  background: linear-gradient(135deg, #ef4444, #f87171);
  box-shadow: 0 6px 20px rgba(239, 68, 68, .30);
}

.card-tile.entrepreneur .tile-name {
  color: #991b1b;
}

.card-tile.entrepreneur .tile-action {
  border-top-color: rgba(239, 68, 68, .15);
}

.card-tile.entrepreneur .tile-arrow-circle {
  background: rgba(239, 68, 68, .10);
  color: #ef4444;
  border: 1.5px solid rgba(239, 68, 68, .22);
}

.card-tile.entrepreneur:hover .tile-arrow-circle {
  background: #ef4444;
  color: white;
  border-color: transparent;
}

/* =========================================================
   TILE MEDIA WRAP  (card image + video preview)
   Extensible: add .tile-media-wrap to any .card-tile
   ========================================================= */
.tile-media-wrap {
  position: relative;
  width: 100%;
  height: 172px;
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 18px;
  flex-shrink: 0;
  /* Inner glow border */
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08), 0 4px 16px rgba(15, 23, 42, .08);
}

/* Themed background per card type */
.card-tile.personnel .tile-media-wrap {
  background: linear-gradient(140deg, #dcfce7 0%, #f0fdf4 100%);
}

.card-tile.relative .tile-media-wrap {
  background: linear-gradient(140deg, #fef3c7 0%, #fffbeb 100%);
}

.card-tile.student .tile-media-wrap {
  background: linear-gradient(140deg, #dbeafe 0%, #eff6ff 100%);
}

.card-tile.entrepreneur .tile-media-wrap {
  background: linear-gradient(140deg, #fee2e2 0%, #fff1f2 100%);
}

/* Card preview image */
.tile-media-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px 20px;
  filter: drop-shadow(0 6px 14px rgba(15, 23, 42, .22));
  transform: scale(1) rotate(-1deg);
  transform-origin: center bottom;
  transition: opacity .45s var(--ease), transform .45s var(--ease-spring);
  will-change: transform, opacity;
  user-select: none;
  -webkit-user-drag: none;
}

.card-tile:hover .tile-media-img {
  transform: scale(1.04) rotate(0deg);
}

/* Video preview */
.tile-media-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity .5s var(--ease);
  will-change: opacity;
}

.card-tile.has-media:hover .tile-media-video {
  opacity: 1;
}

.card-tile.has-media:hover .tile-media-img {
  opacity: 1;
}

/* "ตัวอย่าง" badge */
.tile-media-badge {
  position: absolute;
  bottom: 9px;
  right: 9px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: white;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transform: translateY(5px);
  transition: opacity .3s var(--ease), transform .3s var(--ease-spring);
  pointer-events: none;
  letter-spacing: .02em;
  z-index: 3;
}

.card-tile:hover .tile-media-badge {
  opacity: 1;
  transform: translateY(0);
}

/* Animated live dot on the badge */
.tmb-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  animation: tmbPulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes tmbPulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: .5;
    transform: scale(.7);
  }
}

/* Tiles WITH media: reduce top padding slightly, icon-wrap hidden */
.card-tile.has-media {
  padding-top: 28px;
}

.card-tile.has-media .tile-icon-wrap {
  display: none;
}

/* Lightweight animated ornament for home tiles */
.tile-ornament {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 108px;
  height: 108px;
  pointer-events: none;
  z-index: 0;
}

.tile-orbit,
.tile-core,
.tile-spark {
  position: absolute;
  border-radius: 999px;
}

.tile-orbit {
  inset: 12px;
  border: 1.5px solid color-mix(in srgb, var(--tile-accent) 34%, white);
  opacity: .45;
  animation: tileOrbitFloat 9s ease-in-out infinite;
}

.tile-orbit.orbit-b {
  inset: 0;
  opacity: .24;
  animation-duration: 11s;
  animation-direction: reverse;
}

.tile-core {
  width: 38px;
  height: 38px;
  top: 35px;
  left: 35px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .95) 0%, var(--tile-accent-soft) 45%, rgba(255, 255, 255, 0) 100%);
  box-shadow: 0 0 0 14px rgba(255, 255, 255, .35);
  animation: tileCorePulse 4.6s ease-in-out infinite;
}

.tile-spark {
  background: linear-gradient(135deg, rgba(255, 255, 255, .95), color-mix(in srgb, var(--tile-accent) 78%, white));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--tile-accent) 18%, transparent);
}

.tile-spark.spark-a {
  width: 32px;
  height: 10px;
  top: 18px;
  left: 14px;
  transform: rotate(-28deg);
  animation: tileSparkDrift 7s ease-in-out infinite;
}

.tile-spark.spark-b {
  width: 14px;
  height: 14px;
  right: 16px;
  bottom: 18px;
  animation: tileSparkBlink 3.8s ease-in-out infinite;
}

@keyframes tileOrbitFloat {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-6px) scale(1.04);
  }
}

@keyframes tileCorePulse {

  0%,
  100% {
    transform: scale(1);
    opacity: .92;
  }

  50% {
    transform: scale(1.14);
    opacity: .62;
  }
}

@keyframes tileSparkDrift {

  0%,
  100% {
    transform: rotate(-28deg) translate3d(0, 0, 0);
  }

  50% {
    transform: rotate(-18deg) translate3d(8px, 6px, 0);
  }
}

@keyframes tileSparkBlink {

  0%,
  100% {
    transform: scale(.9);
    opacity: .55;
  }

  50% {
    transform: scale(1.18);
    opacity: 1;
  }
}

.card-tile:hover .tile-orbit {
  animation-duration: 4.6s;
  opacity: .7;
}

.card-tile:hover .tile-spark.spark-a {
  transform: rotate(-8deg) translate3d(12px, 4px, 0);
}

.card-tile:hover .tile-spark.spark-b {
  transform: scale(1.22);
}

/* Decorative top-left circle */
.card-tile-deco {
  position: absolute;
  top: -70px;
  left: -70px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: currentColor;
  opacity: .03;
  pointer-events: none;
}

/* Tile content */
.tile-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  border-radius: 18px;
  margin-bottom: 18px;
  z-index: 1;
}

.tile-icon {
  font-size: 30px;
  line-height: 1;
}

.tile-name {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.3px;
  margin-bottom: 3px;
  position: relative;
  z-index: 1;
}

.tile-name-en {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: .6px;
  text-transform: uppercase;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.tile-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.tile-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.tile-action-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
}

.tile-arrow-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: transform .3s var(--ease-spring), background .2s, color .2s, border-color .2s;
}

.card-tile:hover .tile-arrow-circle {
  transform: translateX(4px);
}

/* Home Track Banner */
.home-track-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 760px;
  margin-top: 28px;
  padding: 18px 24px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  cursor: pointer;
  transition: all .25s var(--ease);
  box-shadow: var(--shadow-sm);
  animation: fadeSlideUp .6s var(--ease) .9s both;
}

.home-track-banner:hover {
  border-color: var(--psu-blue-mid);
  box-shadow: 0 8px 32px rgba(37, 99, 235, .12);
  transform: translateY(-3px);
}

.htb-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.htb-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--psu-blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.htb-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--psu-blue);
  margin-bottom: 2px;
}

.htb-sub {
  font-size: 13px;
  color: var(--text-3);
}

.htb-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--psu-blue-light);
  color: var(--psu-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  transition: transform .25s var(--ease-spring), background .2s;
}

.home-track-banner:hover .htb-arrow {
  transform: translateX(4px);
  background: var(--psu-blue);
  color: white;
}

/* Footer hint */
.home-footer-hint {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
  animation: fadeSlideUp .6s var(--ease) 1s both;
}

/* =========================================================
   FLOATING BACKGROUND PARTICLES
   ========================================================= */
.bg-floats {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.bf {
  position: absolute;
  bottom: -50px;
  opacity: 0;
  animation: floatUp linear infinite;
}

.bf-cross {
  font-style: normal;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.bf-drop {
  border-radius: 50% 50% 50% 50% / 56% 56% 44% 44%;
}

/* Individual positions, sizes, colors, timings */
.bf1 {
  left: 5%;
  animation-duration: 9s;
  animation-delay: 0s;
  font-size: 20px;
  color: rgba(22, 163, 74, .38);
}

.bf2 {
  left: 15%;
  animation-duration: 13s;
  animation-delay: -4s;
  width: 8px;
  height: 12px;
  background: rgba(59, 130, 246, .22);
}

.bf3 {
  left: 27%;
  animation-duration: 7s;
  animation-delay: -2s;
  font-size: 14px;
  color: rgba(59, 130, 246, .32);
}

.bf4 {
  left: 38%;
  animation-duration: 15s;
  animation-delay: -7s;
  width: 7px;
  height: 10px;
  background: rgba(22, 163, 74, .20);
}

.bf5 {
  left: 51%;
  animation-duration: 10s;
  animation-delay: -1s;
  font-size: 22px;
  color: rgba(245, 158, 11, .34);
}

.bf6 {
  left: 61%;
  animation-duration: 12s;
  animation-delay: -5s;
  width: 10px;
  height: 14px;
  background: rgba(245, 158, 11, .18);
}

.bf7 {
  left: 73%;
  animation-duration: 8s;
  animation-delay: -3s;
  font-size: 16px;
  color: rgba(239, 68, 68, .28);
}

.bf8 {
  left: 83%;
  animation-duration: 14s;
  animation-delay: -9s;
  width: 7px;
  height: 10px;
  background: rgba(22, 163, 74, .20);
}

.bf9 {
  left: 11%;
  animation-duration: 11s;
  animation-delay: -6s;
  font-size: 18px;
  color: rgba(22, 163, 74, .34);
}

.bf10 {
  left: 44%;
  animation-duration: 16s;
  animation-delay: -11s;
  width: 9px;
  height: 13px;
  background: rgba(59, 130, 246, .20);
}

.bf11 {
  left: 68%;
  animation-duration: 9s;
  animation-delay: -8s;
  font-size: 15px;
  color: rgba(245, 158, 11, .32);
}

.bf12 {
  left: 91%;
  animation-duration: 13s;
  animation-delay: -2s;
  width: 8px;
  height: 11px;
  background: rgba(245, 158, 11, .18);
}

@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translateY(0) translateX(0) rotate(0deg) scale(.8);
  }

  8% {
    opacity: 1;
  }

  25% {
    transform: translateY(-25vh) translateX(14px) rotate(90deg) scale(1);
  }

  50% {
    transform: translateY(-52vh) translateX(-9px) rotate(180deg) scale(1.1);
  }

  75% {
    transform: translateY(-76vh) translateX(12px) rotate(270deg) scale(.9);
  }

  88% {
    opacity: .5;
  }

  100% {
    opacity: 0;
    transform: translateY(-108vh) translateX(-5px) rotate(540deg) scale(.7);
  }
}

/* =========================================================
   BUTTONS (Global)
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--r-md);
  border: 1.5px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: all .22s var(--ease);
  white-space: nowrap;
}

.btn:active {
  transform: scale(.97);
}

.btn:disabled {
  background: #f1f5f9 !important;
  color: #94a3b8 !important;
  border-color: #e2e8f0 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
  opacity: 0.65;
}

.btn-primary {
  background: var(--psu-blue);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(30, 58, 138, .25);
}

.btn-primary:hover {
  background: #1e40af;
  box-shadow: 0 8px 24px rgba(30, 58, 138, .35);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--text-1);
}

.btn-approve {
  background: var(--green-main);
  color: var(--white);
  box-shadow: 0 4px 12px var(--green-glow);
}

.btn-approve:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--green-glow);
}

.btn-reject {
  background: var(--red-main);
  color: var(--white);
  box-shadow: 0 4px 12px var(--red-glow);
}

.btn-reject:hover {
  background: var(--red-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--red-glow);
}

.btn-print {
  background: var(--blue-main);
  color: var(--white);
  box-shadow: 0 4px 12px var(--blue-glow);
}

.btn-print:hover {
  background: var(--blue-dark);
  transform: translateY(-2px);
}

.btn-distribute {
  background: var(--green-dark);
  color: var(--white);
}

.btn-distribute:hover {
  background: #14532d;
  transform: translateY(-2px);
}

.btn-edit-btn {
  background: #8b5cf6;
  color: var(--white);
}

.btn-edit-btn:hover {
  background: #7c3aed;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
  border-radius: var(--r-sm);
}

.btn-lg {
  padding: 13px 30px;
  font-size: 16px;
}

.btn-full {
  width: 100%;
}

/* =========================================================
   TRACK STATUS VIEW
   ========================================================= */
.track-body {
  flex: 1;
}

.track-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 24px 72px;
}

.track-hero {
  text-align: center;
  margin-bottom: 36px;
}

.track-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -.3px;
  margin-bottom: 8px;
}

.track-sub {
  font-size: 15px;
  color: var(--text-2);
}

/* Mode Tabs */
.track-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

.track-tab {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: all .22s var(--ease);
}

.track-tab>span {
  font-size: 30px;
  flex-shrink: 0;
}

.track-tab-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 2px;
}

.track-tab-sub {
  font-size: 12px;
  color: var(--text-3);
}

.track-tab:hover {
  border-color: var(--psu-blue-mid);
  background: #f5f8ff;
}

.track-tab.active {
  border-color: var(--psu-blue-mid);
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}

.track-tab.active .track-tab-title {
  color: var(--psu-blue);
}

/* Form Card */
.track-form-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: 40px 36px;
  text-align: center;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.track-form-icon {
  font-size: 44px;
  margin-bottom: 14px;
}

.track-form-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 8px;
}

.track-form-desc {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 28px;
  line-height: 1.7;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

.track-input-group {
  text-align: left;
  margin-bottom: 14px;
}

.track-input-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.track-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 18px;
  padding: 12px 16px;
  background: var(--psu-blue-light);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--psu-blue);
  text-align: left;
  line-height: 1.5;
}

/* Results */
.track-results-header {
  margin-bottom: 14px;
}

.track-results-found {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
}

.track-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.track-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.track-card-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 6px;
}

.track-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Timeline */
.track-timeline {
  padding: 24px 24px 12px;
}

.tl-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding-bottom: 4px;
  position: relative;
}

.tl-item:not(:last-child) {
  padding-bottom: 0;
}

.tl-line-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.tl-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  border: 2px solid var(--border);
  background: white;
  color: var(--text-3);
  flex-shrink: 0;
  z-index: 1;
}

.tl-connector {
  width: 2px;
  height: 28px;
  border-radius: 1px;
  background: var(--border);
  flex-shrink: 0;
}

.tl-content {
  padding-top: 7px;
  flex: 1;
  padding-bottom: 20px;
}

.tl-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}

.tl-date {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

.tl-badge-now {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  padding: 3px 10px;
  background: var(--psu-blue);
  color: white;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  animation: pulseBadge 2s ease-in-out infinite;
}

@keyframes pulseBadge {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, .4);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0);
  }
}

/* State styles */
.tl-done .tl-dot {
  background: #dcfce7;
  border-color: #16a34a;
  color: #16a34a;
}

.tl-done .tl-connector {
  background: #16a34a;
}

.tl-connector-done {
  background: #16a34a !important;
}

.tl-done .tl-label {
  color: var(--text-2);
}

.tl-current .tl-dot {
  background: var(--psu-blue);
  border-color: var(--psu-blue);
  color: white;
  font-size: 10px;
}

.tl-current .tl-label {
  color: var(--psu-blue);
  font-weight: 800;
  font-size: 15px;
}

.tl-pending .tl-dot {
  border-style: dashed;
}

.tl-rejected .tl-dot {
  background: #fee2e2;
  border-color: #ef4444;
  color: #ef4444;
}

.tl-rejected .tl-label {
  color: #ef4444;
}

.tl-editing .tl-dot {
  background: #f3f0ff;
  border-color: #8b5cf6;
  color: #8b5cf6;
}

.tl-editing .tl-label {
  color: #8b5cf6;
}

/* Special notices */
.track-special-notice {
  margin: 0 24px 20px;
  padding: 14px 18px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
}

.track-special-notice.rejected {
  background: #fff5f5;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.track-special-notice.editing {
  background: #faf5ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.notice-reason {
  font-weight: 400;
  margin-top: 6px;
  font-size: 13px;
}

.track-fix-btn {
  margin-top: 14px;
  border: none;
  border-radius: 999px;
  background: #6d28d9;
  color: #fff;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-thai);
  box-shadow: 0 10px 24px rgba(109, 40, 217, .22);
}

.track-fix-btn:hover {
  opacity: .92;
  transform: translateY(-1px);
}

/* Not found */
.track-not-found {
  text-align: center;
  padding: 48px 24px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
}

.tnf-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.track-not-found h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 8px;
}

.track-not-found p {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.7;
}

@media (max-width: 600px) {
  .track-mode-tabs {
    grid-template-columns: 1fr;
  }

  .track-form-card {
    padding: 28px 20px;
  }
}

/* =========================================================
   RESPONSIVE — NAV
   ========================================================= */

/* ── Tablet (≤ 900px): ซ่อน brand subtitle + shrink padding ── */
@media (max-width: 900px) {
  .home-nav {
    padding: 0 20px;
    gap: 10px;
  }

  .nav-brand-sub {
    display: none;
  }

  .nav-user-pos {
    display: none;
  }

  .nav-user-dept {
    display: none;
  }

  .nav-user-name {
    font-size: 12px;
  }

  .btn-admin-nav {
    padding: 8px 14px;
    font-size: 13px;
    gap: 5px;
  }
}

/* ── Mobile (≤ 640px): nav เป็น 2 แถว, user info เรียงซ้าย-ขวา ── */
@media (max-width: 640px) {
  .home-nav {
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    padding: 8px 16px;
    gap: 6px;
  }

  /* แถวบน: logo + brand name ขยายเต็ม */
  .nav-brand {
    flex: 1 1 100%;
    min-width: 0;
  }

  .nav-logo-bg {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    padding: 5px;
    animation: none;
    /* ปิด float animation บน mobile */
  }

  .nav-logo {
    height: 26px;
  }

  .nav-brand-name {
    font-size: 14px;
  }

  .nav-brand-sub {
    display: none;
  }

  /* แถวล่าง: right section ขยายเต็มแถว */
  .nav-right {
    flex: 1 1 100%;
    justify-content: space-between;
    gap: 8px;
  }

  /* User info pill: ขยายเต็ม เหลือพื้นที่ให้ปุ่ม admin */
  .nav-user-info {
    flex: 1;
    min-width: 0;
    padding: 4px 10px 4px 5px;
    border-radius: 30px;
  }

  /* ซ่อน detail text เหลือแค่ชื่อ + badge */
  .nav-user-pos {
    display: none;
  }

  .nav-user-dept {
    display: none;
  }

  .nav-user-name {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
  }

  /* ปุ่ม admin: เหลือแค่ icon ไม่มีข้อความ */
  .btn-admin-nav {
    padding: 8px 12px;
    font-size: 0;
    /* ซ่อนข้อความ */
    gap: 0;
    flex-shrink: 0;
  }

  .btn-admin-nav::before {
    content: "⚙️";
    font-size: 18px;
  }
}

/* ── Very small (≤ 380px): compact เพิ่มเติม ── */
@media (max-width: 380px) {
  .home-nav {
    padding: 6px 12px;
  }

  .nav-user-avatar {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .nav-user-name {
    max-width: 90px;
  }
}

/* =========================================================
   REGISTER VIEW
   ========================================================= */
.register-topbar {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 16px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .04);
}

.register-topbar-type {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-1);
  flex: 1;
}

.type-card-thumb {
  display: inline-block;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
  border: 1px solid rgba(255, 255, 255, .75);
}

.type-card-thumb-inline {
  width: 42px;
  height: 28px;
  border-radius: 10px;
}

.type-card-thumb-preview {
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.type-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.type-dot.personnel {
  background: var(--green-main);
}

.type-dot.relative {
  background: var(--purple-main);
}

.type-dot.student {
  background: var(--blue-main);
}

.type-dot.entrepreneur {
  background: var(--red-main);
}

.register-body {
  flex: 1;
  padding: 36px 24px 64px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

/* Progress Steps */
.progress-steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin: 0 auto 36px;
  max-width: 640px;
  justify-content: center;
}

.step-item {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  max-width: 160px;
}

.step-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.step-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-3);
  transition: all .3s var(--ease);
  position: relative;
  z-index: 1;
}

.step-circle.done {
  background: var(--text-1);
  border-color: var(--text-1);
  color: var(--white);
}

.step-circle.active {
  border-width: 2.5px;
  color: var(--white);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, .07);
}

.step-item.personnel .step-circle.active {
  background: var(--green-main);
  border-color: var(--green-main);
  box-shadow: 0 0 0 4px var(--green-glow);
}

.step-item.relative .step-circle.active {
  background: var(--yellow-main);
  border-color: var(--yellow-main);
  box-shadow: 0 0 0 4px var(--yellow-glow);
}

.step-item.student .step-circle.active {
  background: var(--blue-main);
  border-color: var(--blue-main);
  box-shadow: 0 0 0 4px var(--blue-glow);
}

.step-item.entrepreneur .step-circle.active {
  background: var(--red-main);
  border-color: var(--red-main);
  box-shadow: 0 0 0 4px var(--red-glow);
}

.step-item.needs-fix .step-circle {
  border-color: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, .12);
}

.step-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  margin-top: 7px;
  white-space: nowrap;
  text-align: center;
}

.step-item.done .step-label,
.step-item.active .step-label {
  color: var(--text-1);
}

.step-fix-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 10px;
  font-weight: 700;
}

.register-edit-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #fdba74;
}

.step-connector {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin-bottom: 24px;
  transition: background .4s;
}

.step-connector.done {
  background: var(--text-1);
}

/* =========================================================
   PERSONNEL SINGLE-PAGE REQUEST WORKSPACE
   ========================================================= */
.register-body.personnel-single-body {
  max-width: 1480px;
  padding: 24px 22px 72px;
}

.personnel-single-mode-chip {
  margin-left: auto;
  padding: 6px 10px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  color: #166534;
  font-size: 11px;
  font-weight: 800;
}

.personnel-single-workspace {
  display: grid;
  grid-template-columns: minmax(560px, 1.35fr) minmax(390px, .8fr);
  align-items: stretch;
  overflow: clip;
  border: 1px solid #dbe4df;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, .09);
  animation: personnelWorkspaceIn .42s var(--ease) both;
}

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

.personnel-single-form {
  min-width: 0;
  padding: 34px 38px 30px;
  background: #fff;
}

.personnel-single-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  position: sticky;
  top: 64px;
  z-index: 8;
  margin: -12px -16px 0;
  padding: 12px 16px 24px;
  border-bottom: 1px solid #e5ebe8;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 12px 22px -22px rgba(15, 23, 42, .45);
  backdrop-filter: blur(14px);
}

.personnel-single-kicker {
  margin-bottom: 7px;
  color: #15803d;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.personnel-single-header h1 {
  margin: 0;
  color: #111827;
  font-size: 27px;
  font-weight: 900;
  line-height: 1.25;
}

.personnel-single-header p {
  max-width: 580px;
  margin: 8px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.65;
}

.personnel-single-request-type {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  color: #166534;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.personnel-single-section {
  padding: 28px 0;
  border-bottom: 1px solid #e5ebe8;
}

.personnel-single-section-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.personnel-single-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 8px;
  background: #ecfdf5;
  color: #15803d;
}

.personnel-workspace-icon {
  width: 18px;
  height: 18px;
}

.personnel-single-section-head h2 {
  margin: 0;
  color: #111827;
  font-size: 16px;
  font-weight: 850;
}

.personnel-single-section-head p {
  margin: 3px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
}

.personnel-single-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.personnel-single-field-grid .field-group:last-child {
  grid-column: 1 / -1;
  max-width: calc(50% - 8px);
}

.personnel-single-field-grid .field-input {
  min-height: 46px;
  border-radius: 8px;
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.personnel-single-field-grid .field-input:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .11);
  transform: translateY(-1px);
}

.personnel-optional-label {
  margin-left: 6px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
}

.personnel-delivery-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.personnel-delivery-option {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-height: 78px;
  padding: 15px;
  border: 1px solid #dbe3df;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
}

.personnel-delivery-option:hover {
  border-color: #86efac;
  transform: translateY(-2px);
}

.personnel-delivery-option.selected {
  border-color: #22c55e;
  background: #f0fdf4;
  box-shadow: 0 8px 20px rgba(21, 128, 61, .08);
}

.personnel-delivery-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.personnel-delivery-radio {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 1px;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 4px #fff;
  transition: border-color .2s ease, background .2s ease;
}

.personnel-delivery-option.selected .personnel-delivery-radio {
  border-color: #16a34a;
  background: #16a34a;
}

.personnel-delivery-option strong,
.personnel-delivery-option small {
  display: block;
}

.personnel-delivery-option strong {
  color: #17201c;
  font-size: 13px;
  font-weight: 800;
}

.personnel-delivery-option small {
  margin-top: 4px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.45;
}

.personnel-single-evidence > .rl-correction-banner {
  margin-bottom: 18px;
}

.personnel-single-evidence .student-upload-panel {
  grid-template-columns: 1fr;
  gap: 12px;
}

.personnel-single-evidence .rl-proof-card {
  padding: 17px;
  border-radius: 8px;
  border-color: #dfe7e3;
  background: #fbfdfc;
}

.personnel-single-evidence .rl-upload-box {
  min-height: 116px;
  border-radius: 8px;
  border-color: #86efac;
  background: #f0fdf4;
}

.personnel-single-evidence .rl-upload-box:hover {
  border-color: #16a34a;
  background: #dcfce7;
}

.personnel-single-evidence .rl-upload-title {
  color: #166534;
}

.personnel-single-evidence .rl-choice-box,
.personnel-single-evidence .personnel-profile-sync-option {
  border-radius: 8px;
}

.personnel-single-submitbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 26px;
  animation: personnelSubmitIn .4s .12s var(--ease) both;
}

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

.personnel-submit-note {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1 1 auto;
  min-width: 260px;
  max-width: 860px;
  padding: 14px 16px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(240, 253, 244, .94), rgba(255, 255, 255, .98));
  box-shadow: 0 12px 30px rgba(22, 101, 52, .08);
  color: #166534;
}

.personnel-submit-note > span:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  background: #dcfce7;
  color: #15803d;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, .16);
}

.personnel-submit-note strong,
.personnel-submit-note small {
  display: block;
}

.personnel-submit-note strong {
  max-width: 820px;
  color: #14532d;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.55;
}

.personnel-submit-note small {
  width: fit-content;
  margin-top: 8px;
  padding: 7px 10px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: #dc2626;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.3;
}

.personnel-submit-warning-copy {
  min-width: 0;
}

.personnel-submit-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.personnel-submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 210px;
  min-height: 48px;
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(21, 128, 61, .2);
  transition: transform .2s ease, box-shadow .2s ease;
}

.personnel-submit-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(21, 128, 61, .25);
}

.personnel-submit-button .personnel-workspace-icon {
  width: 17px;
  height: 17px;
}

.personnel-submit-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: personnelSpinner .7s linear infinite;
}

@keyframes personnelSpinner { to { transform: rotate(360deg); } }

.personnel-single-aside {
  min-width: 0;
  padding: 34px 32px;
  border-left: 1px solid #dbe4df;
  background: #f5f8f6;
}

.personnel-preview-sticky {
  position: sticky;
  top: 86px;
}

.personnel-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.personnel-preview-head span {
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.personnel-preview-head h2 {
  margin: 4px 0 0;
  color: #142019;
  font-size: 18px;
  font-weight: 900;
}

.personnel-preview-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #166534;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.personnel-preview-live span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .12);
  animation: personnelLivePulse 1.8s ease-in-out infinite;
}

@keyframes personnelLivePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .55; transform: scale(.78); }
}

#personnel-live-preview-target .rl-card-preview-heading,
#personnel-live-preview-target .rl-card-preview-desc {
  display: none;
}

#personnel-live-preview-target .rl-card-preview-section {
  margin: 0;
}

#personnel-live-preview-target .rl-card-preview-row {
  min-height: 520px;
  justify-content: center;
  align-items: flex-start;
  padding-top: 8px;
}

#personnel-live-preview-target .rl-card-preview-label {
  margin-bottom: 8px;
  color: #166534;
}

#personnel-live-preview-target .rl-card-face-container.personnel {
  transform: scale(1.38);
  transform-origin: top center;
  box-shadow: 0 24px 48px rgba(15, 23, 42, .2);
}

.personnel-preview-data {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 6px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid #dbe4df;
}

.personnel-preview-data > div {
  min-width: 0;
  padding: 10px 12px 10px 0;
}

.personnel-preview-data > div:first-child,
.personnel-preview-data > div:nth-child(4) {
  grid-column: 1 / -1;
}

.personnel-preview-data dt {
  margin-bottom: 3px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 750;
}

.personnel-preview-data dd {
  overflow-wrap: anywhere;
  color: #17201c;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

@media (max-width: 1080px) {
  .register-body.personnel-single-body { padding-inline: 14px; }
  .personnel-single-workspace { grid-template-columns: minmax(500px, 1.2fr) minmax(330px, .8fr); }
  .personnel-single-form { padding: 30px 28px; }
  .personnel-single-aside { padding: 30px 22px; }
  #personnel-live-preview-target .rl-card-face-container.personnel { transform: scale(1.2); }
  #personnel-live-preview-target .rl-card-preview-row { min-height: 455px; }
}

@media (max-width: 820px) {
  .register-body.personnel-single-body { padding: 14px 10px 56px; }
  .personnel-single-workspace { grid-template-columns: 1fr; overflow: visible; }
  .personnel-single-aside { order: -1; padding: 24px 18px 20px; border-left: 0; border-bottom: 1px solid #dbe4df; }
  .personnel-preview-sticky { position: static; }
  .personnel-single-header {
    position: static;
    margin: 0;
    padding: 0 0 22px;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }
  #personnel-live-preview-target .rl-card-preview-row { min-height: 440px; }
  #personnel-live-preview-target .rl-card-face-container.personnel { transform: scale(1.15); }
  .personnel-preview-data { max-width: 560px; margin-inline: auto; }
  .personnel-single-form { padding: 26px 20px; }
  .personnel-single-mode-chip { display: none; }
}

@media (max-width: 560px) {
  .personnel-single-workspace { border-radius: 8px; }
  .personnel-single-header { flex-direction: column; gap: 13px; padding-bottom: 22px; }
  .personnel-single-header h1 { font-size: 23px; }
  .personnel-single-section { padding: 24px 0; }
  .personnel-single-field-grid,
  .personnel-delivery-options { grid-template-columns: 1fr; }
  .personnel-single-field-grid .field-group:last-child { grid-column: auto; max-width: none; }
  .personnel-single-submitbar { align-items: stretch; flex-direction: column; }
  .personnel-submit-actions { display: grid; grid-template-columns: .7fr 1.3fr; }
  .personnel-submit-button { min-width: 0; width: 100%; padding-inline: 12px; font-size: 13px; }
  .personnel-single-aside { padding-inline: 14px; }
  .personnel-preview-head { align-items: center; }
  #personnel-live-preview-target .rl-card-preview-row { min-height: 400px; }
  #personnel-live-preview-target .rl-card-face-container.personnel { transform: scale(1.03); }
  .personnel-preview-data { grid-template-columns: 1fr 1fr; }
  .personnel-preview-data > div { padding-right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .personnel-single-workspace,
  .personnel-single-submitbar,
  .personnel-preview-live span,
  .personnel-submit-spinner { animation: none; }
  .personnel-delivery-option,
  .personnel-submit-button,
  .personnel-single-field-grid .field-input { transition: none; }
}

.progress-step-current {
  display: none;
}

@media (max-width: 640px) {
  .register-body {
    padding: 20px 12px 56px;
  }

  .progress-steps {
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: none;
    margin: 0 0 10px;
    padding: 13px 14px;
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 18px;
    background: rgba(255, 255, 255, .78);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
    backdrop-filter: blur(14px);
  }

  .step-item {
    flex: 0 0 auto;
    max-width: none;
    align-items: center;
  }

  .step-wrap {
    flex: 0 0 auto;
  }

  .step-circle {
    width: 34px;
    height: 34px;
    border-width: 1.5px;
    font-size: 12px;
  }

  .step-circle.done {
    background: #0f172a;
    border-color: #0f172a;
  }

  .step-circle.active {
    box-shadow: 0 0 0 6px rgba(15, 23, 42, .06);
  }

  .step-label {
    display: none;
  }

  .step-connector {
    height: 3px;
    width: clamp(34px, 9vw, 54px);
    min-width: 0;
    flex: 0 0 auto;
    margin: 0 9px;
    border-radius: 999px;
    background: #dbe3ef;
  }

  .step-connector.done {
    background: #0f172a;
  }

  .progress-step-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 18px;
    padding: 10px 14px;
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 16px;
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
  }

  .progress-step-current span {
    color: var(--text-3);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .5px;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .progress-step-current strong {
    color: var(--text-1);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
    text-align: right;
  }
}

@media (max-width: 380px) {
  .progress-steps {
    padding: 12px 10px;
  }

  .step-circle {
    width: 31px;
    height: 31px;
  }

  .step-connector {
    width: clamp(20px, 7vw, 30px);
    margin: 0 6px;
  }

  .progress-step-current {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .progress-step-current strong {
    text-align: left;
  }
}

/* Form Panel */
.form-panel {
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 36px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, .07);
  margin-bottom: 20px;
  animation: panelIn .3s var(--ease);
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateX(16px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.form-step-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.3px;
  margin-bottom: 4px;
}

.form-step-sub {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 28px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.form-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.form-grid.cols-1 {
  grid-template-columns: 1fr;
}

.col-span-2 {
  grid-column: span 2;
}

.col-span-3 {
  grid-column: span 3;
}

.field-group {
  display: flex;
  flex-direction: column;
}

.field-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 7px;
}

.field-group label .req {
  color: var(--red-main);
  margin-left: 3px;
}

.field-input,
.field-select {
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 15px;
  color: var(--text-1);
  background: var(--white);
  outline: none;
  width: 100%;
  transition: border-color .2s, box-shadow .2s;
}

.field-input:focus,
.field-select:focus {
  border-color: var(--psu-blue-mid);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.field-input::placeholder {
  color: var(--text-3);
}

.field-input.is-readonly,
.field-select.is-readonly {
  background: #f8fafc;
  color: var(--text-2);
  border-color: #d7e1ec;
  box-shadow: none;
}

.field-input.is-readonly {
  cursor: default;
}

.field-select.is-readonly {
  cursor: not-allowed;
}

.form-section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 8px 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}

.field-hint {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 5px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 24px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, .05);
}

.form-actions .spacer {
  flex: 1;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* Review Panel */
.review-panel {
  background: #f8fafc;
  border: 1px dashed var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
}

.review-section {
  margin-bottom: 24px;
}

.review-section:last-child {
  margin-bottom: 0;
}

.review-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.review-row {
  display: flex;
  gap: 12px;
  font-size: 14px;
  margin-bottom: 10px;
}

.review-key {
  color: var(--text-3);
  min-width: 160px;
  flex-shrink: 0;
  font-size: 13px;
}

.review-val {
  color: var(--text-1);
  font-weight: 600;
}

/* Relative card preview (confirmation step) */
.rl-card-preview-section {
  margin: 0 0 24px 0;
}

.rl-card-preview-heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 2px;
}

.rl-card-preview-desc {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 14px;
}

.rl-card-preview-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.rl-card-preview-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.rl-card-preview-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* Card face container — portrait ID-card ratio (54:85.6 ≈ 0.631) */
.rl-card-face-container {
  position: relative;
  width: 220px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .18);
  container-type: inline-size;
}

.rl-card-face-img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
}

/* Photo overlay — centered in white photo area */
.rl-card-ol-photo {
  position: absolute;
  top: 26%;
  left: 50%;
  transform: translateX(-50%);
  width: 38%;
  aspect-ratio: 3 / 4;
  border-radius: 4px;
  overflow: hidden;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .22);
  border: 2px solid #fff;
}

.rl-card-ol-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rl-cp-ph-icon {
  font-size: 36px;
  color: #94a3b8;
}

/* Name overlay — below photo */
.rl-card-ol-name {
  position: absolute;
  top: 60.5%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  text-align: center;
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(255, 255, 255, .9);
}

/* Orange section overlays */
.rl-card-ol-staff-id {
  position: absolute;
  top: 73%;
  left: 42%;
  right: 3%;
  font-size: 15px;
  font-weight: 500;
  color: black;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.rl-card-ol-staff-name {
  position: absolute;
  top: 78%;
  left: 42%;
  right: 3%;
  font-size: 15px;
  font-weight: 500;
  color: black;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.rl-card-ol-expiry {
  position: absolute;
  top: 85.5%;
  left: 42%;
  right: 3%;
  font-size: 15px;
  font-weight: 500;
  color: black;
  white-space: nowrap;
  line-height: 1.3;
}



.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-submitted {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde047;
}

.status-approved {
  background: #dcfce7;
  color: #14532d;
  border: 1px solid #86efac;
}

.status-rejected {
  background: #fee2e2;
  color: #7f1d1d;
  border: 1px solid #fca5a5;
}

.status-printing {
  background: #dbeafe;
  color: #1e3a8a;
  border: 1px solid #93c5fd;
}

.status-distributed {
  background: #d1fae5;
  color: #064e3b;
  border: 1px solid #6ee7b7;
}

.status-editing {
  background: #ede9fe;
  color: #4c1d95;
  border: 1px solid #c4b5fd;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.type-badge.personnel {
  background: var(--green-light);
  color: var(--green-dark);
}

.type-badge.relative {
  background: var(--yellow-light);
  color: #92400e;
}

.type-badge.student {
  background: var(--blue-light);
  color: var(--blue-dark);
}

.type-badge.entrepreneur {
  background: var(--red-light);
  color: var(--red-dark);
}

/* =========================================================
   ADMIN LAYOUT
   ========================================================= */
.admin-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  min-width: 0;
}

.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--admin-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  border-right: 1px solid var(--admin-border);
}

.admin-sidebar-top {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--admin-border);
}

.admin-logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.admin-logo {
  height: 38px;
  width: auto;
}

.admin-logo-text {
  font-size: 14px;
  font-weight: 800;
  color: var(--white);
  line-height: 1.2;
}

.admin-logo-sub {
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.admin-badge-panel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(245, 158, 11, .15);
  border: 1px solid rgba(245, 158, 11, .25);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  color: #fbbf24;
  letter-spacing: .3px;
}

.admin-nav {
  flex: 1;
  padding: 10px 0;
}

.admin-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #475569;
  padding: 14px 16px 5px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin: 1px 6px;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .15s, color .15s;
  position: relative;
}

.admin-nav-item:hover {
  background: var(--admin-surface);
  color: #e2e8f0;
}

.admin-nav-item.active {
  background: var(--admin-surface);
  color: var(--white);
}

.admin-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--psu-blue-mid);
  border-radius: 0 3px 3px 0;
  margin-left: -6px;
}

.admin-nav-icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.admin-nav-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  background: rgba(255, 255, 255, .08);
  color: #94a3b8;
}

.admin-nav-count.urgent {
  background: var(--red-main);
  color: var(--white);
}

.admin-nav-divider {
  height: 1px;
  background: var(--admin-border);
  margin: 8px 14px;
}

.admin-sidebar-foot {
  padding: 14px 16px;
  border-top: 1px solid var(--admin-border);
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--admin-surface);
  border-radius: var(--r-md);
}

.admin-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--psu-blue-mid), #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}

.admin-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
}

.admin-user-role {
  font-size: 11px;
  color: #64748b;
}

/* Admin Main */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-topbar {
  height: 60px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.admin-menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text-1);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
  transition: background .18s, border-color .18s, transform .18s;
}

.admin-menu-btn span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform .18s, opacity .18s;
}

.admin-menu-btn.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.admin-menu-btn.open span:nth-child(2) {
  opacity: 0;
}

.admin-menu-btn.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.admin-menu-btn:active {
  transform: scale(.96);
}

.admin-topbar-title {
  flex: 1;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.3px;
}

.admin-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

/* Bell button */
.admin-bell-btn {
  position: relative;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 6px 10px;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  transition: background .15s;
}

.admin-bell-btn:hover {
  background: var(--admin-surface);
}

.admin-bell-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9999px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  pointer-events: none;
}

.admin-bell-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  z-index: 200;
  overflow: hidden;
}

.admin-sidebar-backdrop {
  display: none;
}

.bell-drop-head {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  background: var(--admin-surface);
}

.bell-drop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}

.bell-drop-row:hover {
  background: #f8fafc;
}

.bell-drop-row--active {
  background: #fff7ed;
}

.bell-drop-label {
  font-size: 13px;
  font-weight: 500;
}

.bell-drop-count {
  font-size: 13px;
  font-weight: 700;
  color: #6b7280;
}

.bell-drop-count--new {
  color: #dc2626;
}

.bell-drop-foot {
  padding: 8px 10px;
  border-top: 1px solid var(--border);
}

/* Settings add-row card */
.settings-add-card {
  background: rgba(255, 255, 255, .9);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.settings-add-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-add-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .2px;
}

.settings-add-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-add-input {
  height: 40px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-1);
  background: #fff;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  min-width: 200px;
}

.settings-add-input:focus {
  border-color: var(--psu-blue-mid);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}

.settings-add-input::placeholder {
  color: var(--text-3);
  font-size: 13px;
}

.settings-add-btn {
  height: 40px;
  white-space: nowrap;
}

/* Admin logout button */
.admin-logout-btn {
  width: 100%;
  padding: 8px 12px;
  background: rgba(239, 68, 68, .08);
  border: 1px solid rgba(239, 68, 68, .2);
  border-radius: var(--r-md);
  color: #b91c1c;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.admin-logout-btn:hover {
  background: rgba(239, 68, 68, .15);
  border-color: rgba(239, 68, 68, .35);
}

.admin-content {
  flex: 1;
  padding: 28px 32px;
  min-width: 0;
}

/* Admin Stats */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
  min-width: 0;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .7px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}

.stat-card-value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
}

.stat-card-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}

/* Filter */
.admin-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.admin-filter-row h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.4px;
  flex: 1;
  min-width: 0;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, .95);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  min-width: 280px;
  transition: border-color .2s, box-shadow .2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .06);
}

.search-bar:focus-within {
  border-color: var(--psu-blue-mid);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12), 0 2px 6px rgba(0, 0, 0, .06);
}

.search-bar>span {
  font-size: 15px;
  opacity: .5;
  flex-shrink: 0;
}

.search-bar input {
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-1);
  outline: none;
  flex: 1;
  font-family: inherit;
  min-width: 0;
}

.search-bar input::placeholder {
  color: var(--text-3);
  font-size: 13px;
}

/* Status filter tabs */
.status-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(241, 245, 249, .8);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
  backdrop-filter: blur(8px);
}

.status-tab {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--r-sm);
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-2);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  transition: all .2s;
}

.status-tab:hover {
  background: rgba(255, 255, 255, .8);
  color: var(--text-1);
}

.status-tab.active {
  background: var(--white);
  color: var(--text-1);
  box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
}

.status-tab .count-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 100px;
  background: rgba(15, 23, 42, .08);
}

/* Wish (request-type) filter row */
.wish-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 6px 10px;
  margin-top: 4px;
  background: rgba(248, 250, 252, .7);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

.wish-tabs-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  white-space: nowrap;
  margin-right: 2px;
  flex-shrink: 0;
}

.wish-tab {
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--r-sm);
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  transition: all .15s;
  white-space: nowrap;
}

.wish-tab:hover {
  background: rgba(255, 255, 255, .9);
  border-color: var(--border);
  color: var(--text-1);
}

.wish-tab.active {
  background: var(--white);
  color: var(--psu-blue-mid, #2563eb);
  border-color: rgba(37, 99, 235, .25);
  box-shadow: 0 1px 4px rgba(15, 23, 42, .08);
  font-weight: 600;
}

.wish-tab .count-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 100px;
  background: rgba(15, 23, 42, .07);
}

.wish-tab.active .count-pill {
  background: rgba(37, 99, 235, .12);
  color: var(--psu-blue-mid, #2563eb);
}

/* Partial-load notice banner */
.admin-partial-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  margin-bottom: 6px;
  background: rgba(234, 179, 8, .08);
  border: 1px solid rgba(234, 179, 8, .25);
  border-radius: var(--r-sm);
  font-size: 12px;
  color: #92400e;
}

.admin-partial-banner span {
  flex: 1;
}

@media (max-width: 600px) {
  .admin-partial-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

.admin-source-note {
  display: grid;
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: linear-gradient(135deg, rgba(255, 255, 255, .95), rgba(248, 250, 252, .92));
  box-shadow: var(--shadow-sm);
}

.admin-source-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
}

.admin-source-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-1);
}

.admin-source-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
}

/* Requests Table */
.table-wrap {
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  max-width: 100%;
}

.admin-bulk-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #f8fafc 0%, #ecfdf5 100%);
  border-bottom: 1px solid #dbeafe;
  position: relative;
  animation: adminBulkEnter .22s ease-out both;
}

.admin-bulk-panel.is-active {
  background: linear-gradient(135deg, #eff6ff 0%, #ecfdf5 100%);
}

.admin-bulk-panel.is-saving {
  padding-bottom: 28px;
}

.admin-bulk-left,
.admin-bulk-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.admin-bulk-master {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.admin-bulk-master input,
.admin-row-select input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.admin-bulk-checkmark,
.admin-row-select span {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid #bfdbfe;
  background: #fff;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.9);
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
  position: relative;
  flex: 0 0 auto;
}

.admin-bulk-checkmark::after,
.admin-row-select span::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 4px;
  width: 7px;
  height: 12px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(.45);
  opacity: 0;
  transition: opacity .14s ease, transform .14s ease;
}

.admin-bulk-master input:checked + .admin-bulk-checkmark,
.admin-row-select input:checked + span {
  background: #16a34a;
  border-color: #16a34a;
  transform: scale(1.03);
}

.admin-bulk-master input:checked + .admin-bulk-checkmark::after,
.admin-row-select input:checked + span::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}

.admin-bulk-master strong {
  display: block;
  color: var(--text-1);
  font-size: 14px;
}

.admin-bulk-master small {
  display: block;
  color: var(--text-3);
  font-size: 12px;
  margin-top: 2px;
}

.admin-bulk-selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-bulk-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34,197,94,.45);
  animation: adminBulkPulse 1.35s ease-out infinite;
}

.admin-bulk-link {
  border: 0;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  padding: 8px;
}

.admin-bulk-link:hover {
  color: #0f172a;
}

.admin-bulk-status-picker {
  position: relative;
}

.admin-bulk-status-picker::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  transform: translateY(-50%);
  pointer-events: none;
}

.admin-bulk-status-picker select {
  height: 40px;
  border: 1px solid #bfdbfe;
  background: rgba(255, 255, 255, .92);
  border-radius: 999px;
  color: #0f172a;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
  min-width: 190px;
  padding: 0 36px 0 30px;
  cursor: pointer;
}

.admin-bulk-status-picker select:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, .16);
  background: #fff;
}

.admin-bulk-approve-btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 15px;
  background: #16a34a;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(22, 163, 74, .22);
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
  white-space: nowrap;
}

.admin-bulk-approve-btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.admin-bulk-approve-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(22, 163, 74, .28);
}

.admin-bulk-approve-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
}

.admin-bulk-progress {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 9px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-bulk-progress-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(148,163,184,.24);
  overflow: hidden;
  flex: 1;
}

.admin-bulk-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #16a34a);
  transition: width .18s ease;
}

.admin-bulk-progress-text {
  font-size: 11px;
  color: #475569;
  font-weight: 800;
  white-space: nowrap;
}

.admin-bulk-modal-header {
  background:
    radial-gradient(circle at 86% 22%, rgba(34, 197, 94, .14), transparent 28%),
    linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.admin-bulk-modal-eyebrow {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #16a34a;
  margin-bottom: 4px;
}

.admin-bulk-modal-count {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #166534;
  font-size: 12px;
  font-weight: 900;
}

.admin-bulk-modal-body {
  animation: adminBulkEnter .2s ease-out both;
}

.admin-bulk-modal-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid #bbf7d0;
  border-radius: 18px;
  background: linear-gradient(135deg, #f0fdf4, #eff6ff);
  margin-bottom: 16px;
}

.admin-bulk-modal-icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #16a34a;
  background: #fff;
  box-shadow: 0 12px 24px rgba(22, 163, 74, .14);
  flex: 0 0 auto;
}

.admin-bulk-modal-icon svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.admin-bulk-modal-hero h3 {
  margin: 0 0 4px;
  font-size: 18px;
  color: #0f172a;
}

.admin-bulk-modal-hero p {
  margin: 0;
  color: #64748b;
  line-height: 1.6;
  font-size: 13px;
}

.admin-bulk-modal-grid {
  display: grid;
  grid-template-columns: minmax(460px, 1.28fr) minmax(420px, .92fr);
  gap: 16px;
}

.admin-bulk-modal-section {
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}

.admin-bulk-modal-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.admin-bulk-modal-section-head strong {
  color: #0f172a;
  font-size: 14px;
}

.admin-bulk-modal-section-head span {
  color: #94a3b8;
  font-size: 12px;
  text-align: right;
}

.admin-bulk-review-list {
  max-height: min(52vh, 520px);
  overflow: auto;
  contain: content;
}

.admin-bulk-review-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid #f1f5f9;
}

.admin-bulk-review-row strong,
.admin-bulk-review-row span {
  display: block;
}

.admin-bulk-review-row strong {
  color: #0f172a;
  font-size: 13px;
}

.admin-bulk-review-row span {
  color: #94a3b8;
  font-size: 12px;
  margin-top: 3px;
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.admin-bulk-review-row em {
  font-style: normal;
  color: #64748b;
  font-size: 12px;
  flex: 0 0 auto;
}

.admin-bulk-review-more {
  padding: 13px 16px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.admin-bulk-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}

.admin-bulk-status-tile {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 78px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.admin-bulk-status-tile:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, .08);
}

.admin-bulk-status-tile.selected {
  border-color: #60a5fa;
  background: #eff6ff;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, .14);
}

.admin-bulk-status-tile:disabled {
  cursor: not-allowed;
  opacity: .72;
}

.admin-bulk-status-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #2563eb;
  background: #eff6ff;
  flex: 0 0 auto;
}

.admin-bulk-status-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.admin-bulk-status-tile.approve .admin-bulk-status-icon,
.admin-bulk-status-tile.distribute .admin-bulk-status-icon {
  color: #16a34a;
  background: #dcfce7;
}

.admin-bulk-status-tile.reject .admin-bulk-status-icon {
  color: #dc2626;
  background: #fee2e2;
}

.admin-bulk-status-tile.edit .admin-bulk-status-icon {
  color: #7c3aed;
  background: #f3e8ff;
}

.admin-bulk-status-tile.print .admin-bulk-status-icon {
  color: #0369a1;
  background: #e0f2fe;
}

.admin-bulk-status-tile strong,
.admin-bulk-status-tile small {
  display: block;
}

.admin-bulk-status-tile strong {
  font-size: 13px;
  color: #0f172a;
}

.admin-bulk-status-tile small {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.35;
  color: #64748b;
}

.admin-bulk-note-label {
  display: block;
  padding: 0 16px 7px;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.admin-bulk-note-input {
  display: block;
  width: calc(100% - 32px);
  min-height: 94px;
  margin: 0 16px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: 12px 14px;
  resize: vertical;
  font: inherit;
  font-size: 14px;
  outline: none;
}

.admin-bulk-note-input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, .14);
}

.admin-bulk-modal-progress {
  margin: 0 16px 16px;
}

.admin-bulk-modal-progress-track {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.admin-bulk-modal-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #16a34a);
  transition: width .18s ease;
}

.admin-bulk-modal-progress-text {
  margin-top: 7px;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.admin-bulk-col,
.admin-bulk-cell {
  width: 58px;
  text-align: center !important;
}

.admin-row-select {
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.admin-row-select-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: #cbd5e1;
  font-weight: 900;
}

.req-table tbody tr.admin-row-selected {
  background: #f0fdf4;
}

.req-table tbody tr.admin-row-selected:hover {
  background: #dcfce7;
}

@keyframes adminBulkEnter {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes adminBulkPulse {
  to { box-shadow: 0 0 0 9px rgba(34,197,94,0); }
}

@media (prefers-reduced-motion: reduce) {
  .admin-bulk-panel,
  .admin-bulk-pulse,
  .admin-bulk-progress-track span,
  .admin-bulk-modal-body,
  .admin-bulk-modal-progress-track span,
  .admin-bulk-status-tile,
  .admin-bulk-approve-btn,
  .admin-bulk-checkmark,
  .admin-row-select span {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 760px) {
  .admin-bulk-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-bulk-modal-grid {
    grid-template-columns: 1fr;
  }

  .admin-bulk-modal-hero {
    align-items: flex-start;
  }

  .admin-bulk-status-grid {
    grid-template-columns: 1fr;
  }

  .admin-bulk-review-list {
    max-height: 320px;
  }

  .admin-bulk-review-row span {
    max-width: 220px;
  }

  .admin-bulk-left,
  .admin-bulk-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .admin-bulk-status-picker,
  .admin-bulk-status-picker select {
    width: 100%;
  }

  .admin-bulk-approve-btn {
    flex: 1;
    justify-content: center;
  }

  .admin-bulk-progress {
    position: static;
    margin-top: -4px;
  }

  .admin-bulk-panel.is-saving {
    padding-bottom: 14px;
  }
}

.req-table {
  width: 100%;
  border-collapse: collapse;
}

.req-table th {
  padding: 13px 18px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--text-3);
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.req-table td {
  padding: 14px 18px;
  font-size: 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.req-table tbody tr {
  cursor: pointer;
  transition: background .15s;
}

.req-table tbody tr:hover {
  background: #f8fafc;
}

.req-table tbody tr:last-child td {
  border-bottom: none;
}

.td-name {
  font-weight: 700;
  font-size: 15px;
}

.td-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}

.td-id {
  font-size: 12px;
  color: var(--text-3);
  font-family: 'Space Mono', monospace;
}

.td-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-request-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--psu-blue);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.admin-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  color: var(--text-2);
  font-size: 13px;
}

.admin-table-toolbar strong {
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
}

.admin-table-note {
  color: var(--text-3);
  text-align: right;
  line-height: 1.5;
}

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.admin-page-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-2);
  border-radius: 999px;
  padding: 7px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}

.admin-page-btn:hover:not(:disabled) {
  background: #eff6ff;
  color: var(--psu-blue);
  border-color: #bfdbfe;
}

.admin-page-btn:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.admin-page-current {
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* =========================================================
   MODAL
   ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: var(--white);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 40px 120px rgba(15, 23, 42, .35);
  transform: scale(.94) translateY(20px);
  transition: transform .35s var(--ease-spring);
}

.modal-box.admin-bulk-modal-shell {
  max-width: min(1280px, calc(100vw - 56px));
}

.modal-overlay.open .modal-box {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}

.modal-header-info {
  flex: 1;
}

.modal-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.3px;
  margin-bottom: 8px;
}

.modal-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text-2);
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  font-family: inherit;
}

.modal-close:hover {
  background: var(--text-1);
  color: var(--white);
  border-color: var(--text-1);
}

.modal-body {
  padding: 24px 28px;
}

.modal-info-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 20px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.modal-info-section-title:first-child {
  margin-top: 0;
}

.modal-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 4px;
}

.modal-info-item label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 4px;
  display: block;
}

.modal-info-item span {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
}

.modal-info-item .mono {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
}

.modal-info-profile-sync {
  grid-column: 1 / -1;
  padding: 12px 14px;
  border: 1px solid #86efac;
  border-left: 4px solid #16a34a;
  border-radius: 8px;
  background: #f0fdf4;
}

.modal-info-profile-sync label {
  color: #166534;
}

.modal-info-profile-sync span {
  color: #14532d;
}

.modal-info-expiry-highlight {
  grid-column: 1 / -1;
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 16px 20px;
  border: 1px solid #f59e0b;
  border-left: 6px solid #f59e0b;
  border-radius: 14px;
  background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 100%);
  box-shadow: 0 14px 30px -22px rgba(146, 64, 14, .65);
}

.modal-info-expiry-highlight::before {
  content: "!";
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #f59e0b;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 8px 18px -10px rgba(146, 64, 14, .9);
}

.modal-info-expiry-highlight label {
  margin: 0;
  color: #92400e;
  font-size: 13px;
  letter-spacing: .3px;
}

.modal-info-expiry-highlight span {
  justify-self: end;
  color: #7c2d12;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.15;
  text-align: right;
}

.admin-renewal-expiry-grid {
  margin: 16px 0 4px;
}

.modal-footer {
  padding: 20px 28px 24px;
  border-top: 1px solid var(--border);
  background: #f8fafc;
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}

.modal-footer-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 12px;
}

.modal-footer-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 12px;
}

.modal-footer-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* Timeline */
.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 16px;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 28px;
  width: 2px;
  bottom: 0;
  background: var(--border);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  z-index: 1;
  background: #f1f5f9;
  color: var(--text-3);
  border: 2px solid var(--border);
}

.timeline-dot.current {
  background: var(--psu-blue);
  border-color: var(--psu-blue);
  color: var(--white);
}

.timeline-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  padding-top: 3px;
}

.timeline-date {
  font-size: 12px;
  color: var(--text-3);
}

.timeline-comment {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
}

/* Reject reason */
.reject-reason-box {
  margin-top: 14px;
  padding: 16px;
  background: #fff1f2;
  border: 1px solid #fca5a5;
  border-radius: var(--r-md);
}

.reject-reason-box label {
  font-size: 13px;
  font-weight: 700;
  color: #7f1d1d;
  margin-bottom: 10px;
  display: block;
}

.reject-reason-box textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #fca5a5;
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--text-1);
  outline: none;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.reject-reason-box textarea:focus {
  border-color: var(--red-main);
}

.correction-box {
  background: #faf5ff;
  border-color: #d8b4fe;
}

.correction-box label {
  color: #6d28d9;
}

.correction-box textarea {
  border-color: #d8b4fe;
}

.correction-box textarea:focus {
  border-color: #7c3aed;
}

.correction-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin-bottom: 12px;
}

.correction-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .8);
  border: 1px solid #e9d5ff;
  font-size: 13px;
  color: var(--text-2);
}

.correction-check-item input {
  accent-color: #7c3aed;
}

.modal-correction-box {
  margin-bottom: 16px;
}

.modal-correction-note {
  margin-bottom: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 13px;
  line-height: 1.6;
}

.modal-media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.admin-personnel-card-preview {
  display: flex;
  justify-content: center;
  padding: 18px 16px 26px;
  margin-bottom: 20px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fbff 0%, #f0fdf4 100%);
}

.admin-personnel-card-preview .rl-card-face-container.personnel {
  width: min(340px, 72vw);
  box-shadow: 0 18px 42px rgba(15, 23, 42, .18);
}

.modal-media-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.modal-media-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
}

.modal-media-preview {
  height: 180px;
  min-height: 180px;
  aspect-ratio: auto;
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
}

.modal-media-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.modal-media-fallback {
  width: 100%;
  height: 100%;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.5;
}

.modal-media-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--psu-blue);
  text-decoration: none;
}

.modal-media-link:hover {
  text-decoration: underline;
}

.user-detail-media-grid {
  grid-template-columns: minmax(180px, 260px);
}

.user-detail-media-card {
  max-width: 260px;
}

.user-detail-photo-preview {
  aspect-ratio: 3 / 4;
}

.admin-alert-box {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  font-size: 14px;
  line-height: 1.7;
}

.admin-alert-box.editing {
  background: #faf5ff;
  border: 1px solid #ddd6fe;
  color: #6d28d9;
}

.admin-alert-box.rejected {
  background: #fff5f5;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.admin-alert-box.neutral {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: var(--text-2);
}

.admin-approval-history {
  display: grid;
  gap: 0;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: #fff;
}

.admin-approval-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 12px;
  position: relative;
}

.admin-approval-item:not(:last-child)::before {
  content: '';
  position: absolute;
  top: 17px;
  bottom: -3px;
  left: 4px;
  width: 2px;
  background: #dbeafe;
}

.admin-approval-dot {
  width: 10px;
  height: 10px;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--psu-blue-mid);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
}

.admin-approval-body {
  min-width: 0;
  padding-bottom: 18px;
}

.admin-approval-item:last-child .admin-approval-body {
  padding-bottom: 0;
}

.admin-approval-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.admin-approval-head strong {
  color: var(--text-1);
  font-size: 14px;
}

.admin-approval-head span {
  color: var(--text-3);
  font-size: 12px;
  white-space: nowrap;
}

.admin-approval-actor {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 6px;
  color: var(--text-3);
  font-size: 12.5px;
  line-height: 1.4;
}

.admin-approval-actor span {
  display: inline-flex;
  align-items: center;
}

.admin-approval-comment {
  margin-top: 5px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.6;
}

.admin-approval-empty {
  margin-bottom: 16px;
  padding: 13px 16px;
  border: 1px dashed #cbd5e1;
  border-radius: var(--r-md);
  background: #f8fafc;
  color: var(--text-3);
  font-size: 13px;
}

.admin-review-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid #bfdbfe;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 62%);
}

.admin-review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.admin-review-kicker {
  margin-bottom: 5px;
  color: var(--psu-blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.admin-review-title {
  color: var(--text-1);
  font-size: 16px;
  font-weight: 800;
}

.admin-review-desc {
  margin-top: 4px;
  color: var(--text-3);
  font-size: 12px;
}

.admin-decision-comment {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: rgba(255, 255, 255, .92);
  color: var(--text-1);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  outline: none;
  padding: 12px 14px;
  transition: border-color .15s, box-shadow .15s;
}

.admin-decision-comment:focus {
  border-color: var(--psu-blue-mid);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.admin-decision-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.admin-decision-btn {
  display: grid;
  gap: 4px;
  align-content: start;
  min-height: 76px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: #fff;
  color: var(--text-2);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}

.admin-decision-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.admin-decision-btn:disabled {
  cursor: progress;
  opacity: .6;
}

.admin-decision-btn strong {
  color: var(--text-1);
  font-size: 13px;
}

.admin-decision-btn span {
  font-size: 11px;
  line-height: 1.45;
}

.admin-decision-btn.approve {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.admin-decision-btn.edit {
  border-color: #ddd6fe;
  background: #faf5ff;
}

.admin-decision-btn.reject {
  border-color: #fecaca;
  background: #fff5f5;
}

.admin-decision-btn.print {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.admin-decision-btn.distribute {
  border-color: #fed7aa;
  background: #fff7ed;
}

.admin-review-idle {
  padding: 13px 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: rgba(255, 255, 255, .82);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.6;
}

.admin-blueprint {
  display: grid;
  gap: 18px;
}

.admin-blueprint-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding: 24px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 54%, #f8fafc 100%);
  border: 1px solid #dbeafe;
  box-shadow: var(--shadow-sm);
}

.admin-blueprint-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--psu-blue);
  margin-bottom: 8px;
}

.admin-blueprint-title {
  font-size: 26px;
  line-height: 1.2;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 10px;
}

.admin-blueprint-copy {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.8;
  max-width: 760px;
}

.admin-blueprint-badge {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .08);
  color: var(--psu-blue);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.admin-blueprint-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.admin-blueprint-panel {
  background: rgba(255, 255, 255, .95);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.admin-blueprint-panel-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 12px;
}

.admin-blueprint-panel-body {
  display: grid;
  gap: 10px;
}

.admin-blueprint-panel-body span,
.admin-blueprint-stage span {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
}

.admin-blueprint-stage-list {
  display: grid;
  gap: 12px;
}

.admin-blueprint-stage {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.admin-blueprint-stage strong {
  display: block;
  font-size: 13px;
  color: var(--text-1);
  margin-bottom: 6px;
}

/* =========================================================
   SUCCESS MODAL
   ========================================================= */
.success-modal {
  max-width: 440px;
  text-align: center;
  padding: 44px 40px;
  margin: 0 auto;
}

.success-icon {
  font-size: 60px;
  display: block;
  margin-bottom: 20px;
  animation: successBounce .7s var(--ease-spring);
}

@keyframes successBounce {
  0% {
    transform: scale(0) rotate(-10deg);
    opacity: 0;
  }

  60% {
    transform: scale(1.15) rotate(5deg);
    opacity: 1;
  }

  100% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

.success-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.5px;
  margin-bottom: 10px;
}

.success-body {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 24px;
}

.success-id {
  font-family: 'Space Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 24px;
  border-radius: var(--r-md);
  background: #f8fafc;
  border: 1px dashed var(--border);
  margin-bottom: 28px;
  display: inline-block;
  color: var(--psu-blue);
}

.success-countdown-note {
  margin: -10px auto 22px;
  max-width: 360px;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.6;
}

.success-countdown-note strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  margin: 0 3px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--psu-blue);
  font-variant-numeric: tabular-nums;
}

.success-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* =========================================================
   TOAST
   ========================================================= */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  min-width: 280px;
  max-width: 380px;
  pointer-events: all;
  animation: toastIn .35s var(--ease-spring);
  box-shadow: 0 12px 40px rgba(15, 23, 42, .20);
  backdrop-filter: blur(12px);
}

.toast.info {
  background: rgba(30, 58, 138, .95);
  color: var(--white);
}

.toast.success {
  background: rgba(22, 163, 74, .95);
  color: var(--white);
}

.toast.error {
  background: rgba(220, 38, 38, .95);
  color: var(--white);
}

.toast .t-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.toast .t-msg {
  flex: 1;
  line-height: 1.4;
}

.toast .t-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, .7);
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  font-family: inherit;
}

.toast .t-close:hover {
  color: var(--white);
}

@keyframes toastIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.toast.out {
  animation: toastOut .3s var(--ease) forwards;
}

/* =========================================================
   FILE UPLOAD LOADING OVERLAY
   ========================================================= */
.file-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: all;
  opacity: 0;
  transition: opacity .2s ease;
}

.file-loading-overlay.visible {
  opacity: 1;
}

.file-loading-spinner {
  width: 52px;
  height: 52px;
  border: 5px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spinLoader .75s linear infinite;
  margin-bottom: 16px;
}

@keyframes spinLoader {
  to {
    transform: rotate(360deg);
  }
}

.file-loading-label {
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .02em;
}

/* =========================================================
   UTILITIES
   ========================================================= */
.hidden {
  display: none !important;
}

.mono {
  font-family: 'Space Mono', monospace;
}

.text-muted {
  color: var(--text-3);
}

.empty-state {
  text-align: center;
  padding: 64px 32px;
  color: var(--text-3);
}

.empty-state .ei {
  font-size: 52px;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .admin-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .modal-info-grid {
    grid-template-columns: 1fr;
  }

  .modal-info-expiry-highlight {
    grid-template-columns: auto 1fr;
    gap: 8px 12px;
    padding: 14px 16px;
  }

  .modal-info-expiry-highlight span {
    grid-column: 1 / -1;
    justify-self: start;
    text-align: left;
    font-size: 21px;
  }

  .admin-source-note,
  .admin-blueprint-hero {
    grid-template-columns: 1fr;
    display: grid;
  }

  .admin-blueprint-grid,
  .modal-media-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-main {
    margin-left: 0;
  }

  .hero-title {
    font-size: 28px;
  }

  /* Card grid: cap at 2 per row on tablet */
  .card-grid {
    gap: 16px;
  }

  .card-grid .card-tile {
    flex: 1 1 240px;
  }

  .admin-content {
    padding: 16px;
  }

  .form-grid,
  .form-grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .col-span-2,
  .col-span-3 {
    grid-column: span 1;
  }

  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .home-nav {
    padding: 0 20px;
  }

  .req-table th:nth-child(3),
  .req-table td:nth-child(3) {
    display: none;
  }

  .req-table th:nth-child(5),
  .req-table td:nth-child(5) {
    display: none;
  }

  .admin-table-toolbar,
  .admin-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-table-note {
    text-align: left;
  }

  .admin-pagination {
    align-items: stretch;
  }

  .admin-page-current {
    order: -1;
  }

  .admin-review-head,
  .admin-decision-actions {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}

@media (max-width: 540px) {

  /* Card grid: single column on mobile */
  .card-grid {
    gap: 14px;
  }

  .card-grid .card-tile {
    flex: none;
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 24px;
  }

  .hero-logo-bg {
    width: 100px;
    height: 100px;
    border-radius: 24px;
  }

  .form-panel {
    padding: 22px;
  }

  .admin-stats {
    grid-template-columns: 1fr;
  }

  .status-tabs {
    gap: 2px;
  }

  .status-tab {
    padding: 6px 10px;
    font-size: 12px;
  }

  /* form-actions: ปุ่มยืนยัน/ส่งขยายเต็มแถวบน mobile */
  .form-actions {
    gap: 8px;
    padding: 12px 16px;
  }

  .form-actions .spacer {
    width: 100%;
    flex: none;
    height: 0;
  }

  .form-actions .btn-primary {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  /* card preview: scale down ทั้ง 2 บัตรให้พอดีหน้าจอ */
  .rl-card-preview-row {
    gap: 12px;
    justify-content: center;
  }

  .rl-card-face-container {
    width: 160px;
  }

  .rl-card-ol-name {
    font-size: 11px;
  }
}

@media (max-width: 820px) {
  body.admin-drawer-open {
    overflow: hidden;
  }

  #view-admin {
    overflow-x: hidden;
  }

  .admin-shell {
    display: block;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .admin-sidebar {
    width: min(84vw, 304px);
    transform: translateX(-100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform .22s var(--ease);
    box-shadow: 24px 0 60px rgba(15, 23, 42, .22);
    z-index: 240;
  }

  .admin-sidebar.open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .admin-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .42);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s var(--ease);
    z-index: 220;
  }

  .admin-sidebar-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .admin-main {
    width: 100%;
    margin-left: 0;
  }

  .admin-topbar {
    height: auto;
    min-height: 64px;
    padding: 10px 14px;
    align-items: center;
    gap: 10px;
  }

  .admin-menu-btn {
    display: inline-flex;
    flex: 0 0 42px;
  }

  .admin-topbar-title {
    font-size: 15px;
    line-height: 1.25;
    letter-spacing: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .admin-topbar-right {
    flex-shrink: 0;
    gap: 8px;
  }

  .admin-bell-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #fff;
  }

  .admin-topbar-right .admin-badge-panel {
    height: 42px;
    padding: 0 14px !important;
    border-radius: 999px;
    white-space: nowrap;
  }

  .admin-content {
    padding: 14px;
  }

  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
  }

  .stat-card {
    padding: 14px;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, .05);
  }

  .stat-card:hover {
    transform: none;
  }

  .stat-card-value {
    font-size: 25px;
    letter-spacing: -.4px;
  }

  .stat-card-label {
    font-size: 10px;
    margin-bottom: 6px;
  }

  .stat-card-sub {
    font-size: 11px;
    line-height: 1.45;
  }

  .stat-card-label,
  .stat-card-sub {
    overflow-wrap: anywhere;
  }

  .admin-filter-row {
    align-items: stretch;
    gap: 9px;
    margin-bottom: 14px;
  }

  .admin-filter-row h2 {
    flex: 1 1 100%;
    font-size: 18px;
    line-height: 1.35;
  }

  .admin-filter-row > div {
    width: 100%;
    flex-wrap: wrap;
  }

  .admin-filter-row .search-bar {
    flex: 1 1 260px;
    min-width: 0;
    max-width: 100%;
    border-radius: 14px;
    box-shadow: none;
  }

  .admin-filter-row .btn {
    min-height: 40px;
    border-radius: 12px;
  }

  .admin-source-note {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 13px 14px;
    margin-bottom: 14px;
    border-radius: 14px;
  }

  .status-tabs,
  .wish-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 12px;
    border-radius: 14px;
  }

  .wish-tabs-label {
    position: sticky;
    left: 0;
    z-index: 1;
    padding-right: 8px;
    background: rgba(248, 250, 252, .96);
  }

  .table-wrap {
    border-radius: 16px;
  }

  .admin-table-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 13px 14px;
  }

  .admin-table-note {
    text-align: left;
  }

  .req-table,
  .req-table thead,
  .req-table tbody,
  .req-table tr,
  .req-table td {
    display: block;
    width: 100%;
  }

  .req-table thead {
    display: none;
  }

  .req-table tbody {
    padding: 8px;
  }

  .req-table tbody tr {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    margin-bottom: 8px;
    overflow: hidden;
  }

  .req-table tbody tr:hover {
    background: #fff;
  }

  .req-table td {
    display: grid;
    grid-template-columns: minmax(86px, 32%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    overflow-wrap: anywhere;
  }

  .req-table td::before {
    content: attr(data-label);
    color: var(--text-3);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.45;
  }

  .req-table tbody tr:last-child td {
    border-bottom: 1px solid #f1f5f9;
  }

  .req-table tbody tr td:last-child {
    border-bottom: 0;
  }

  .td-actions {
    justify-content: stretch;
  }

  .td-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .admin-pagination {
    align-items: stretch;
    justify-content: flex-start;
    flex-wrap: wrap;
    padding: 14px 16px;
  }

  .admin-page-current {
    width: 100%;
    order: -1;
  }
}

@media (max-width: 520px) {
  .admin-content {
    padding: 12px 10px 14px;
  }

  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .stat-card {
    padding: 12px;
    min-height: 112px;
  }

  .stat-card:last-child {
    grid-column: 1 / -1;
    min-height: 96px;
  }

  .stat-card-value {
    font-size: 23px;
  }

  .stat-card-sub {
    font-size: 10.5px;
  }

  .admin-filter-row > div {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 8px !important;
  }

  .admin-filter-row .search-bar,
  .admin-filter-row .btn {
    width: 100%;
  }

  .status-tabs,
  .wish-tabs {
    margin-left: -2px;
    margin-right: -2px;
  }

  .req-table tbody {
    padding: 8px;
  }

  .req-table td {
    grid-template-columns: minmax(78px, 30%) minmax(0, 1fr);
    gap: 8px;
    padding: 9px 11px;
  }

  .admin-pagination {
    gap: 6px;
  }

.admin-page-btn {
    flex: 1 1 calc(50% - 6px);
  }
}

/* Mobile polish: home header, admin drawer/table, and register topbar */
@media (max-width: 640px) {
  .home-nav {
    padding: 8px 14px;
  }

  .nav-right {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    width: 100%;
    gap: 8px;
  }

  .nav-user-info {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    width: 100%;
    min-width: 0;
    gap: 8px;
    padding: 5px 8px 5px 5px;
  }

  .nav-user-avatar {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }

  .nav-user-detail {
    min-width: 0;
    overflow: hidden;
  }

  .nav-user-name {
    max-width: none;
    min-width: 0;
    font-size: 12.5px;
    line-height: 1.25;
  }

  .nav-user-meta {
    min-width: 0;
    overflow: hidden;
  }

  .nav-user-badge {
    max-width: 100%;
  }

  .nav-user-info form {
    margin-left: auto !important;
    flex: 0 0 auto;
  }

  .btn-logout-nav {
    width: 38px;
    height: 38px;
    margin-left: auto;
  }

  .btn-admin-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    padding: 0;
    gap: 0;
    font-size: 0;
    line-height: 1;
    border-radius: 18px;
  }

  .btn-admin-nav::before {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    font-size: 21px;
    line-height: 1;
  }

  .register-topbar {
    height: auto;
    min-height: 58px;
    padding: 8px 12px;
    gap: 8px;
    overflow: hidden;
  }

  #register-topbar-content {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    width: 100%;
    min-width: 0;
    gap: 8px;
  }

  .register-topbar .btn {
    min-width: 0;
    max-width: 42vw;
    height: 40px;
    padding: 0 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .register-topbar-type {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    min-width: 0;
    gap: 8px;
    font-size: 15px;
    line-height: 1.18;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .register-topbar-type > span:not(.type-dot):not(.type-card-thumb) {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .type-card-thumb-inline {
    width: 38px;
    height: 26px;
  }

  .register-topbar .text-silver,
  #register-topbar-content > .text-silver {
    justify-self: end;
    max-width: 30vw;
    min-width: 0;
    font-size: 12px;
    line-height: 1.2;
    text-align: right;
    overflow-wrap: anywhere;
  }

  .admin-menu-btn {
    position: relative;
    z-index: 260;
    touch-action: manipulation;
  }

  .admin-sidebar.open {
    transform: translate3d(0, 0, 0) !important;
  }

  .req-table tbody {
    display: grid;
    gap: 12px;
    padding: 10px;
  }

  .req-table tbody tr {
    display: grid;
    grid-template-columns: 1fr;
    margin-bottom: 0;
    border-radius: 18px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, .08);
  }

  .req-table tbody tr.has-bulk-col {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .req-table td {
    display: block;
    width: auto;
    min-width: 0;
    padding: 11px 14px;
    border-bottom: 1px solid #edf2f7;
    text-align: left;
  }

  .req-table td::before {
    display: block;
    margin-bottom: 4px;
    content: attr(data-label);
    color: var(--text-3);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
    text-transform: none;
  }

  .req-table tbody tr.has-bulk-col td:not(.admin-bulk-cell) {
    grid-column: 2;
  }

  .req-table td.admin-bulk-cell {
    grid-column: 1;
    grid-row: 1 / span 6;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 14px 8px;
    border-right: 1px solid #edf2f7;
    border-bottom: 0;
    background: #fbfdff;
  }

  .req-table td.admin-bulk-cell::before,
  .req-table td.td-actions::before {
    display: none;
  }

  .req-table .td-name,
  .req-table .td-sub {
    text-align: left;
  }

  .req-table .td-name {
    font-size: 15px;
    line-height: 1.35;
  }

  .req-table .td-sub {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.35;
  }

  .admin-request-chip,
  .status-badge {
    max-width: 100%;
    white-space: normal;
    justify-content: flex-start;
    line-height: 1.25;
  }

  .td-actions {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 8px;
    justify-content: stretch;
    padding-top: 12px;
  }

  .td-actions .btn,
  .td-actions .admin-delete-btn {
    width: 100%;
    min-height: 42px;
    justify-content: center;
  }
}

@media (max-width: 420px) {
  #register-topbar-content {
    grid-template-columns: auto minmax(0, 1fr);
  }

  #register-topbar-content > .text-silver,
  .register-topbar .text-silver {
    grid-column: 2;
    justify-self: start;
    max-width: 100%;
    text-align: left;
  }

  .register-topbar .btn {
    max-width: 40vw;
  }
}

/* =========================================================
   CARD PREVIEW OVERLAY
   ========================================================= */
.cp-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: rgba(15, 23, 42, .75);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s var(--ease);
}

.cp-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.cp-overlay.cp-closing {
  opacity: 0;
}

.cp-box {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 840px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 40px;
  box-shadow: 0 40px 100px rgba(15, 23, 42, .30);
  transform: translateY(36px) scale(.96);
  transition: transform .45s var(--ease-spring);
}

.cp-overlay.open .cp-box {
  transform: translateY(0) scale(1);
}

.cp-overlay.cp-closing .cp-box {
  transform: translateY(28px) scale(.96);
}

/* Sparkle particles */
.cp-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}

.cp-sparkle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: cpSparkle 3s infinite;
}

@keyframes cpSparkle {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0);
  }

  25% {
    opacity: .85;
    transform: translateY(-12px) scale(1);
  }

  75% {
    opacity: .35;
    transform: translateY(-45px) scale(.7);
  }

  100% {
    opacity: 0;
    transform: translateY(-80px) scale(0);
  }
}

/* Close button */
.cp-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background .2s, color .2s, transform .25s var(--ease-spring);
}

.cp-close:hover {
  background: var(--bg);
  color: var(--text-1);
  transform: scale(1.1) rotate(90deg);
}

/* Header */
.cp-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 32px;
}

.cp-header-icon {
  width: 68px;
  height: 68px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  flex-shrink: 0;
  transition: transform .3s var(--ease-spring);
}

.cp-header-icon:hover {
  transform: scale(1.08) rotate(-4deg);
}

.cp-header-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.cp-icon-personnel {
  background: var(--green-light);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, .12);
}

.cp-icon-relative {
  background: var(--yellow-light);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, .14);
}

.cp-icon-student {
  background: var(--blue-light);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .12);
}

.cp-icon-entrepreneur {
  background: var(--red-light);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, .12);
}

.cp-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1.2;
}

.cp-subtitle {
  font-size: 14px;
  color: var(--text-3);
  margin-top: 3px;
  font-weight: 500;
}

/* Body */
.cp-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: center;
}

/* 3D Card flip */
.cp-card-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.card-3d-wrap {
  perspective: 1200px;
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1664 / 2570;
  /* portrait — matches actual card image ratio */
  cursor: pointer;
  user-select: none;
}

.card-3d-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .8s cubic-bezier(.4, .2, .2, 1);
}

.card-3d-wrap:hover .card-3d-inner:not(.cp-flipped) {
  transform: rotateY(-10deg) rotateX(4deg) scale(1.02);
}

.card-3d-inner.cp-flipped {
  transform: rotateY(180deg);
}

.card-3d-wrap:hover .card-3d-inner.cp-flipped {
  transform: rotateY(170deg) rotateX(4deg) scale(1.02);
}

.card-face {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  overflow: hidden;
  backface-visibility: hidden;
  box-shadow: 0 16px 48px rgba(15, 23, 42, .22), 0 2px 8px rgba(15, 23, 42, .12);
}

.card-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-face-back {
  transform: rotateY(180deg);
}

/* Card placeholder (types without real images) */
.cp-card-ph {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}

.cp-card-ph.personnel {
  background: linear-gradient(140deg, #15803d, #16a34a, #4ade80 140%);
}

.cp-card-ph.relative {
  background: linear-gradient(140deg, #d97706, #f59e0b, #fcd34d 140%);
}

.cp-card-ph.student {
  background: linear-gradient(140deg, #1d4ed8, #3b82f6, #93c5fd 140%);
}

.cp-card-ph.entrepreneur {
  background: linear-gradient(140deg, #dc2626, #ef4444, #fca5a5 140%);
}

.cp-card-ph::before {
  content: '';
  position: absolute;
  right: -20px;
  top: -20px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
}

.cp-card-ph::after {
  content: '';
  position: absolute;
  left: -30px;
  bottom: -30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}

.cp-ph-badge {
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: 9px;
  font-weight: 700;
  color: rgba(255, 255, 255, .8);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.cp-ph-icon {
  position: absolute;
  top: 6px;
  right: 12px;
  font-size: 30px;
}

.cp-ph-name {
  font-size: 13px;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .3);
  position: relative;
  z-index: 1;
}

.cp-ph-sub {
  font-size: 9px;
  color: rgba(255, 255, 255, .75);
  position: relative;
  z-index: 1;
  margin-top: 2px;
}

/* Card back placeholder */
.cp-card-ph.back {
  justify-content: flex-start;
  padding: 0;
  gap: 0;
}

.cp-ph-stripe {
  width: 100%;
  height: 38px;
  background: rgba(0, 0, 0, .55);
  margin-bottom: 10px;
}

.cp-ph-chip {
  width: 44px;
  height: 32px;
  background: linear-gradient(135deg, #fcd34d, #f59e0b);
  border-radius: 6px;
  margin: 4px 14px 10px;
}

.cp-ph-lines {
  margin: 4px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cp-ph-line {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .25);
}

/* =========================================================
   RELATIVE LANDING PAGE
   ========================================================= */

/* Landing wrapper */
.rl-landing {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Loading */
.rl-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 64px;
  color: var(--text-3);
  font-size: 15px;
}

.rl-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--purple-main);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* Dorm summary card */
.rl-dorm-summary-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(135deg, var(--purple-main) 0%, #7c3aed 100%);
  border-radius: var(--r-xl);
  padding: 22px 26px;
  color: #fff;
  box-shadow: 0 8px 32px rgba(139, 92, 246, .30);
}

.rl-dorm-summary-icon {
  font-size: 40px;
  flex-shrink: 0;
  line-height: 1;
}

.rl-dorm-summary-info {
  flex: 1;
}

.rl-dorm-summary-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .75;
  margin-bottom: 4px;
}

.rl-dorm-summary-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.rl-dorm-summary-room {
  font-size: 14px;
  opacity: .85;
  margin-top: 2px;
}

.rl-dorm-summary-right {
  text-align: right;
}

.rl-dorm-summary-user {
  font-size: 15px;
  font-weight: 600;
}

.rl-dorm-summary-type {
  font-size: 12px;
  opacity: .7;
  background: rgba(255, 255, 255, .15);
  padding: 2px 10px;
  border-radius: 20px;
  display: inline-block;
  margin-top: 4px;
}

.rl-correction-center {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%);
  border: 1px solid #fed7aa;
  box-shadow: 0 18px 40px rgba(245, 158, 11, .08);
}

.rl-correction-center-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.rl-correction-center-kicker {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #c2410c;
  margin-bottom: 4px;
}

.rl-correction-center-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1.25;
}

.rl-correction-center-chip {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: #7c3aed;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.rl-correction-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.rl-correction-card {
  background: rgba(255, 255, 255, .92);
  border: 1px solid #e9d5ff;
  border-radius: var(--r-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rl-correction-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.rl-correction-card-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-1);
}

.rl-correction-card-meta {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 3px;
}

.rl-correction-card-note {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.65;
}

.rl-correction-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Section header */
.rl-cards-header {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  margin-top: 4px;
}

.rl-dedup-note {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-4, #9ca3af);
  text-transform: none;
  letter-spacing: 0;
  margin-left: 6px;
}

.rl-cards-header-pending {
  color: #92400e;
  border-bottom-color: #fde68a;
}

.rl-cards-header-rejected {
  color: #9f1239;
  border-bottom-color: #fecdd3;
}

/* Card grid */
.rl-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* Individual relative person card */
.rl-person-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  display: flex;
  gap: 14px;
  transition: box-shadow .2s, border-color .2s;
  position: relative;
}

.rl-person-card:hover {
  border-color: var(--purple-main);
  box-shadow: 0 4px 20px rgba(139, 92, 246, .12);
}

.rl-person-card.rl-active {
  border-color: var(--green-main);
}

.rl-person-card.rl-rejected {
  opacity: .8;
  border-color: #fca5a5;
  background: #fff5f5;
}

.rl-person-card.rl-expired {
  opacity: .7;
  border-style: dashed;
}

.rl-person-card.rl-blocked {
  border-color: #fdba74;
  background: linear-gradient(180deg, #fffaf3 0%, #fff 100%);
}

.rl-unavailable-reason {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 13px;
  line-height: 1.55;
}

/* Photo */
.rl-person-photo {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.rl-person-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rl-photo-placeholder {
  font-size: 32px;
  line-height: 1;
}

/* Person info */
.rl-person-info {
  flex: 1;
  min-width: 0;
}

.rl-person-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rl-person-idcard {
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.rl-person-expire {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

.rl-person-wish {
  font-size: 12px;
  color: #2563eb;
  font-weight: 600;
  margin-top: 3px;
}

.btn-danger {
  background: #dc2626;
  color: #fff;
  border-color: #b91c1c;
}

.btn-danger:hover {
  background: #b91c1c;
  border-color: #991b1b;
  transform: translateY(-1px);
}

.admin-delete-btn {
  margin-left: 6px;
}

/* Status & wish badges */
.rl-status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
  margin-top: 6px;
  margin-right: 4px;
}

.rl-status-active {
  background: var(--green-light);
  color: var(--green-dark);
}

.rl-status-pending {
  background: var(--yellow-light);
  color: var(--yellow-dark);
}

.rl-status-process {
  background: var(--blue-light);
  color: var(--blue-dark);
}

.rl-status-printed {
  background: #f0fdf4;
  color: #166534;
}

.rl-status-done {
  background: #f0fdf4;
  color: #166534;
}

.rl-status-expired {
  background: #f1f5f9;
  color: #64748b;
}

.rl-status-cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.rl-status-editing {
  background: #f3e8ff;
  color: #6d28d9;
}

.rl-status-unknown {
  background: var(--bg);
  color: var(--text-3);
}

.rl-wish-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 8px;
  border-radius: 20px;
  background: var(--bg);
  color: var(--text-3);
  border: 1px solid var(--border);
  margin-top: 4px;
}

.rl-fix-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rl-fix-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: #faf5ff;
  border: 1px solid #ede9fe;
}

.rl-fix-item-dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: #7c3aed;
  flex-shrink: 0;
}

.rl-fix-item-label {
  font-size: 13px;
  font-weight: 700;
  color: #4c1d95;
}

.rl-fix-item-note {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
  line-height: 1.5;
}

/* Person action buttons */
.rl-person-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.rl-action-btn {
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: var(--r-sm);
  padding: 5px 12px;
  cursor: pointer;
  transition: opacity .15s;
  white-space: nowrap;
  font-family: var(--font-thai);
}

.rl-action-btn:hover {
  opacity: .8;
}

.rl-renew {
  background: var(--green-light);
  color: var(--green-dark);
}

.rl-lost {
  background: var(--yellow-light);
  color: var(--yellow-dark);
}

.rl-history {
  background: #ede9fe;
  color: #5b21b6;
}

.rl-fix-now {
  background: #6d28d9;
  color: #fff;
  box-shadow: 0 10px 22px rgba(109, 40, 217, .18);
}

/* photo wrapper: show placeholder emoji only when img absent or broken */
.rl-person-photo {
  position: relative;
}

.rl-ph-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rl-ph-img~.rl-photo-placeholder {
  display: none;
}

.rl-ph-img[style*="none"]~.rl-photo-placeholder,
.rl-person-photo:not(:has(.rl-ph-img)) .rl-photo-placeholder {
  display: flex;
}

/* =========================================================
   RELATIVE HISTORY MODAL
   ========================================================= */
.rl-hist-overlay {
  position: fixed;
  inset: 0;
  z-index: 960;
  background: rgba(15, 23, 42, .6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease);
}

.rl-hist-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.rl-hist-box {
  background: var(--surface);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 820px;
  max-height: min(80vh, 720px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(15, 23, 42, .24);
  transform: translateY(20px);
  transition: transform .35s var(--ease-spring);
}

.rl-hist-overlay.open .rl-hist-box {
  transform: translateY(0);
}

.rl-hist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.rl-hist-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
}

.rl-hist-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg);
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  transition: background .15s;
}

.rl-hist-close:hover {
  background: var(--border);
}

.rl-hist-body {
  overflow-y: auto;
  padding: 16px 20px 24px;
  flex: 1;
}

/* History rows */
.rl-hist-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  margin-bottom: 10px;
  background: var(--surface);
  transition: border-color .15s;
}

.rl-hist-row:hover {
  border-color: var(--purple-main);
}

.rl-hist-photo-wrap {
  flex-shrink: 0;
  width: 80px;
  height: 96px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.rl-hist-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rl-hist-photo-placeholder {
  font-size: 32px;
  line-height: 1;
  color: var(--text-3);
}

.rl-hist-row-info {
  flex: 1;
  min-width: 0;
}

.rl-hist-row-wish {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 3px;
}

.rl-hist-row-date,
.rl-hist-row-expire,
.rl-hist-row-plate {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.6;
}

.rl-hist-row-status {
  flex-shrink: 0;
  align-self: center;
}

.rl-hist-row-note {
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: #fff7ed;
  border: 1px solid #fed7aa;
  font-size: 13px;
  color: #9a3412;
  line-height: 1.6;
}

.rl-hist-row-actions {
  width: 100%;
  margin-top: 10px;
}

.rl-hist-row .rl-fix-list {
  width: 100%;
}

/* History detail toggle/panel */
.rl-hist-detail-toggle {
  width: 100%;
  margin-top: 8px;
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-thai);
  transition: background .15s, color .15s;
}

.rl-hist-detail-toggle:hover,
.rl-hist-detail-toggle.open {
  background: #ede9fe;
  color: #5b21b6;
  border-color: #c4b5fd;
}

.rl-hist-detail-panel {
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

.rl-hist-detail-row {
  display: flex;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.5;
}

.rl-hist-detail-row:last-child {
  border-bottom: none;
}

.rl-hist-detail-key {
  flex: 0 0 160px;
  color: var(--text-3);
  font-weight: 600;
  font-size: 12px;
}

.rl-hist-detail-val {
  flex: 1;
  color: var(--text-1);
  word-break: break-word;
}

.rl-hist-link {
  color: #6d28d9;
  text-decoration: underline;
  font-weight: 600;
}

.rl-hist-link:hover {
  color: #5b21b6;
}

/* ── Clear vehicle fields button ───────────────────────────────────────── */
.rl-clear-vehicle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #dc2626;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
}

.rl-clear-vehicle-btn:hover {
  background: #fecaca;
}

/* ── Admin Attachment Edit Button ──────────────────────────────────────── */
.admin-attach-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--psu-blue);
  background: var(--psu-blue-light);
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s;
}

.admin-attach-edit-btn:hover {
  background: #bfdbfe;
}

.admin-attach-edit-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.modal-media-empty {
  opacity: .7;
}

.modal-media-empty .modal-media-fallback {
  height: 180px;
  min-height: 180px;
  aspect-ratio: auto;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #f8fafc;
  font-size: 13px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-media-card .admin-attach-edit-btn {
  align-self: center;
}

/* ── Admin Receipt Panel ───────────────────────────────────────────────── */
.modal-info-section-title .admin-receipt-load-btn {
  margin-left: 10px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 6px;
  color: #15803d;
  cursor: pointer;
  vertical-align: middle;
}

.modal-info-section-title .admin-receipt-load-btn:hover {
  background: #dcfce7;
}

.admin-receipt-panel {
  margin: 8px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  min-height: 44px;
  background: #fafafa;
  padding: 8px 12px;
}

.admin-receipt-loading,
.admin-receipt-hint {
  font-size: 13px;
  color: var(--text-3);
}

.admin-receipt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.admin-receipt-row:last-child {
  border-bottom: none;
}

.admin-receipt-no {
  font-weight: 700;
  color: var(--text-1);
  min-width: 140px;
}

.admin-receipt-date {
  color: var(--text-2);
  min-width: 100px;
}

.admin-receipt-remark {
  color: var(--text-2);
  flex: 1;
}

.admin-receipt-del-btn {
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #dc2626;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  cursor: pointer;
}

.admin-receipt-del-btn:hover {
  background: #fecaca;
}

.admin-receipt-add-form {
  margin: 12px 0 4px;
  padding: 12px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--r-md);
}

.admin-receipt-form-title {
  font-size: 12px;
  font-weight: 700;
  color: #0369a1;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.admin-receipt-form-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.admin-receipt-input {
  padding: 6px 10px;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  min-width: 80px;
}

/* Hide browser number spinners */
.admin-receipt-input[type=number]::-webkit-outer-spin-button,
.admin-receipt-input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.admin-receipt-date {
  max-width: 140px;
}

.admin-receipt-remark {
  flex: 1;
  min-width: 140px;
}

.admin-receipt-sep {
  font-weight: 700;
  color: var(--text-2);
}

@media (max-width: 640px) {
  .rl-hist-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .rl-hist-box {
    max-height: 88vh;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    max-width: none;
  }

  .rl-correction-center-head,
  .rl-correction-banner-head {
    flex-direction: column;
  }

  .correction-checklist {
    grid-template-columns: 1fr;
  }

  .rl-hist-photo-wrap {
    width: 64px;
    height: 78px;
  }

  .rl-hist-row-status {
    width: 100%;
  }
}

/* Empty state */
.rl-empty-state {
  text-align: center;
  padding: 40px 24px;
  background: var(--bg);
  border-radius: var(--r-xl);
  border: 2px dashed var(--border);
}

.rl-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.rl-empty-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 6px;
}

.rl-empty-sub {
  font-size: 14px;
  color: var(--text-3);
}

/* Add new button */
.rl-add-btn-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.rl-quota-info {
  font-size: 13px;
  color: var(--text-3);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--r-md);
  padding: 6px 16px;
}

.rl-quota-info strong {
  color: #15803d;
}

.rl-quota-pending {
  color: #b45309;
  font-size: 12px;
  margin-left: 6px;
}

/* Inline ID card duplicate hint */
.idcard-dup-hint {
  font-size: 12px;
  margin-top: 5px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  line-height: 1.4;
}

.idcard-dup-hint.idcard-dup-error {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fca5a5;
}

.idcard-dup-hint.idcard-dup-info {
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.rl-quota-full-msg {
  font-size: 14px;
  font-weight: 600;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--r-md);
  padding: 12px 20px;
  text-align: center;
  line-height: 1.6;
}

.rl-new-btn {
  background: var(--purple-main);
  color: #fff;
  border: none;
  border-radius: var(--r-lg);
  padding: 14px 40px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(139, 92, 246, .30);
  transition: opacity .15s, transform .15s;
  font-family: var(--font-thai);
}

.rl-new-btn:hover {
  opacity: .88;
  transform: translateY(-2px);
}

.rl-landing.rl-no-dorm .rl-renew,
.rl-landing.rl-no-dorm .rl-lost {
  display: none;
}

.rl-new-icon {
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, .25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
}

/* =========================================================
   STUDENT LANDING + PREVIEW
   ========================================================= */
.student-landing {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.student-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, .9fr);
  gap: 22px;
  padding: 28px;
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 44%, #bfdbfe 120%);
  color: #fff;
  box-shadow: 0 24px 56px rgba(29, 78, 216, .18);
}

.student-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.student-hero-kicker {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .8;
}

.student-hero-title {
  font-size: 32px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -.03em;
}

.student-hero-sub {
  font-size: 15px;
  line-height: 1.75;
  color: rgba(255, 255, 255, .92);
}

.student-hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.student-hero-points span {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  font-size: 12px;
  font-weight: 600;
}

.student-hero-media {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.student-hero-image {
  width: min(100%, 320px);
  display: block;
  border-radius: 24px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, .22);
  border: 1px solid rgba(255, 255, 255, .26);
}

.student-hero-caption {
  font-size: 12px;
  line-height: 1.65;
  color: rgba(255, 255, 255, .84);
  text-align: center;
  max-width: 300px;
}

.student-profile-card,
.student-access-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-radius: var(--r-xl);
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.student-profile-kicker {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #2563eb;
  margin-bottom: 6px;
}

.student-profile-name {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-1);
}

.student-profile-meta,
.student-profile-hn,
.student-profile-expiry,
.student-access-desc,
.student-request-note {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-3);
}

.student-request-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  line-height: 1.7;
}

.student-profile-side {
  text-align: right;
}

.student-profile-alert {
  align-items: stretch;
}

.student-profile-alert.login-required {
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 62%);
  border-color: #bfdbfe;
}

.student-profile-alert.not-student {
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 62%);
  border-color: #fdba74;
}

.student-profile-alert.needs-review {
  background: linear-gradient(135deg, #eef2ff 0%, #ffffff 62%);
  border-color: #c7d2fe;
}

.student-profile-alert-main {
  flex: 1;
}

.student-profile-alert-side {
  min-width: 240px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.student-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .10);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  text-align: center;
}

.student-profile-alert.not-student .student-status-badge {
  background: rgba(234, 88, 12, .12);
  color: #c2410c;
}

.student-profile-alert.needs-review .student-status-badge {
  background: rgba(79, 70, 229, .10);
  color: #4338ca;
}

.student-status-list {
  margin: 14px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.student-status-list li {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-2);
}

.student-profile-year {
  font-size: 17px;
  font-weight: 800;
  color: #1d4ed8;
  margin-bottom: 6px;
}

.student-profile-hn {
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 4px;
}

.student-access-card.blocked {
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
  border-color: #bfdbfe;
}

.student-access-card.correction {
  align-items: stretch;
  flex-direction: column;
  background: linear-gradient(180deg, #faf5ff 0%, #ffffff 100%);
  border-color: #d8b4fe;
}

.student-access-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 4px;
}

.student-access-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: min(100%, 760px);
  align-items: stretch;
}

.student-action-choice {
  appearance: none;
  min-width: 0;
  min-height: 84px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .06);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.student-action-choice:hover {
  transform: translateY(-2px);
  border-color: #60a5fa;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .12);
}

.student-action-choice:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .24);
  outline-offset: 2px;
}

.student-action-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.student-action-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.student-action-copy strong {
  font-size: 16px;
  line-height: 1.35;
}

.student-action-copy small {
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.student-action-arrow {
  color: #2563eb;
  font-size: 20px;
  transition: transform .18s ease;
}

.student-action-choice:hover .student-action-arrow {
  transform: translateX(3px);
}

.student-action-replace {
  border-color: #fecaca;
}

.student-action-replace .student-action-icon {
  background: #fee2e2;
  color: #b91c1c;
}

.student-action-replace .student-action-arrow {
  color: #b91c1c;
}

.student-action-replace:hover {
  border-color: #f87171;
  box-shadow: 0 10px 24px rgba(185, 28, 28, .10);
}

.student-request-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.student-request-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--r-lg);
  border: 1px solid #dbeafe;
  background: #fff;
}

.student-request-card.correction {
  border-color: #d8b4fe;
  background: rgba(255, 255, 255, .92);
}

.student-request-main {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

.student-request-main .prh-stepper-container {
  box-sizing: border-box;
  margin: 14px 0 0;
  padding: 16px 18px;
  overflow: hidden;
  border-radius: 8px;
  background: #f8fafc;
}

.student-request-main .prh-stepper {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) minmax(24px, .55fr) minmax(72px, 1fr) minmax(24px, .55fr) minmax(72px, 1fr) minmax(24px, .55fr) minmax(72px, 1fr);
  align-items: start;
}

.student-request-main .prh-step {
  min-width: 0;
  width: 100%;
  flex-basis: auto;
}

.student-request-main .prh-step-label {
  width: 100%;
  max-width: 112px;
  min-height: 34px;
  margin: 7px auto 0;
  padding: 0 2px;
  font-size: 11px;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}

.student-request-main .prh-step-line {
  width: calc(100% + 14px);
  min-width: 20px;
  margin: 15px -7px 0;
  transform: none;
}

.student-request-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-1);
}

.student-lock-banner {
  margin-bottom: 24px;
  padding: 16px 18px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
  border: 1px solid #bfdbfe;
}

.student-lock-banner-title {
  font-size: 15px;
  font-weight: 800;
  color: #1d4ed8;
  margin-bottom: 4px;
}

.student-lock-banner-desc {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-2);
}

.student-upload-panel {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.student-upload-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 220px;
  padding: 22px;
  border-radius: var(--r-lg);
  border: 1px dashed #93c5fd;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}

.student-upload-empty-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 6px;
}

.student-upload-empty-desc {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-3);
}

.student-card-preview .rl-card-face-container.student {
  width: 228px;
  aspect-ratio: 54 / 85.6;
}

.student-card-preview .rl-card-face-container.student .rl-card-face-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.student-card-ol-photo {
  position: absolute;
  top: 29%;
  left: 50%;
  transform: translateX(-50%);
  width: 49%;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  overflow: hidden;
  background: #dbeafe;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .18);
}

.student-card-ol-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.student-card-ol-name,
.student-card-ol-surname {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  color: #0f172a;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
}

.student-card-ol-id,
.student-card-ol-dept,
.student-card-ol-year,
.student-card-ol-expiry {
  position: absolute;
  right: 8%;
  text-align: left;
  color: #0f172a;
  max-width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-card-ol-name {
  top: 74%;
  font-size: 22px;
  color: darkblue;
  padding-top: 5px;
}

.student-card-ol-surname {
  top: 84%;
  font-size: 22px;
  color: darkblue;
}

.student-card-ol-id {
  top: 38%;
  font-size: 12px;
  font-weight: 700;
}

.student-card-ol-dept {
  top: 46%;
  font-size: 11px;
  font-weight: 700;
}

.student-card-ol-year {
  top: 55%;
  font-size: 11px;
  font-weight: 700;
}

.student-card-ol-expiry {
  top: 94%;
  font-size: 12px;
  font-weight: 800;
  left: 109px;
  color: white;
}

.student-card-back-hn {
  position: absolute;
  right: 16%;
  top: 1%;
  text-align: left;
  color: #0f172a;
  max-width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 700;
  font-family: monospace;
}

.student-card-back-qrcode-container {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 56.5%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.student-card-back-qrcode {
  width: 44px;
  height: 44px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.student-card-back-qrcode img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.student-card-back-id-text {
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
  font-family: monospace;
  letter-spacing: 0.5px;
}

/* =========================================================
   HN REQUIRED NOTICE
   ========================================================= */
.hn-required-notice {
  border-left: 4px solid #dc2626 !important;
  background: linear-gradient(135deg, #fff1f2 0%, #fff 100%) !important;
}

.hn-required-notice .student-access-title {
  color: #b91c1c;
}

.hn-required-notice .student-status-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.7;
}

/* =========================================================
   PERSONNEL LANDING + PREVIEW
   ========================================================= */
.personnel-landing {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.personnel-hero-card {
  display: none !important;
  background: linear-gradient(135deg, #065f46 0%, #0f766e 46%, #99f6e4 120%);
  box-shadow: 0 24px 56px rgba(6, 95, 70, .18);
}

.personnel-announcement-banner {
  display: none !important;
}

.relative-hero-card {
  margin-bottom: 18px;
  background: linear-gradient(135deg, #92400e 0%, #f59e0b 48%, #fef3c7 118%);
  box-shadow: 0 24px 56px rgba(146, 64, 14, .16);
}

.relative-hero-card .student-hero-kicker {
  color: rgba(255, 255, 255, .78);
}

.relative-hero-card .student-hero-image {
  object-fit: cover;
}

.personnel-profile-card {
  border-color: #a7f3d0;
  background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 62%);
}

.personnel-alert.login-required {
  background: linear-gradient(135deg, #ecfeff 0%, #ffffff 62%);
  border-color: #a5f3fc;
}

.personnel-alert.not-staff {
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 62%);
  border-color: #fdba74;
}

.personnel-alert.needs-review {
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 62%);
  border-color: #86efac;
}

.personnel-ready-card {
  border-color: #86efac;
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 62%);
}

.personnel-blocked-card {
  border-color: #fde68a;
  background: linear-gradient(135deg, #fffbeb 0%, #ffffff 62%);
}

.personnel-correction-card {
  align-items: flex-start;
  border-color: #c4b5fd;
  background: linear-gradient(135deg, #f5f3ff 0%, #ffffff 62%);
}

.personnel-history-card {
  align-items: stretch;
}

.personnel-request-card.rejected {
  border-color: #fecaca;
  background: linear-gradient(135deg, #fff1f2 0%, #ffffff 64%);
}

/* =========================================================
   PERSONNEL REQUEST HISTORY (prh-*)
   ========================================================= */
.personnel-history-section {
  background: #fff;
  border-radius: 16px;
  padding: 20px 22px;
  border: 1.5px solid var(--border);
  box-shadow: 0 2px 12px rgba(15, 23, 42, .06);
}

.personnel-history-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.personnel-history-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
}

.personnel-history-count {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--bg-soft);
  color: var(--text-3);
}

.personnel-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prh-card {
  border: 1.5px solid #e2e8f0;
  border-left-width: 4px;
  border-radius: 10px;
  padding: 14px 16px;
  background: #fafafa;
}

.prh-card.prh-submitted {
  border-left-color: #3b82f6;
  background: #f8faff;
}

.prh-card.prh-approved {
  border-left-color: #16a34a;
  background: #f6fff9;
}

.prh-card.prh-rejected {
  border-left-color: #dc2626;
  background: #fff8f8;
}

.prh-card.prh-printing {
  border-left-color: #8b5cf6;
  background: #faf8ff;
}

.prh-card.prh-distributed {
  border-left-color: #0891b2;
  background: #f6feff;
}

.prh-card.prh-editing {
  border-left-color: #f59e0b;
  background: #fffbf0;
}

.prh-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 4px;
  gap: 10px;
}

.prh-card-top-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.prh-photo {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  object-position: center top;
  border: 1.5px solid #e2e8f0;
  flex-shrink: 0;
  background: #f1f5f9;
}

.prh-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #94a3b8;
}

.prh-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 1px;
}

.prh-id {
  font-size: 13px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  color: var(--text-1);
}

.prh-date {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 8px;
}

.prh-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.prh-badge-submitted {
  background: #dbeafe;
  color: #1d4ed8;
}

.prh-badge-approved {
  background: #dcfce7;
  color: #166534;
}

.prh-badge-rejected {
  background: #fee2e2;
  color: #991b1b;
}

.prh-badge-printing {
  background: #ede9fe;
  color: #5b21b6;
}

.prh-badge-distributed {
  background: #cffafe;
  color: #155e75;
}

.prh-badge-editing {
  background: #fef3c7;
  color: #92400e;
}

.prh-note {
  font-size: 12px;
  line-height: 1.55;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.prh-note-rejected {
  background: #fee2e2;
  color: #991b1b;
}

.prh-note-editing {
  background: #fef3c7;
  color: #78350f;
}

.prh-note-info {
  background: #eff6ff;
  color: #1e40af;
}

.prh-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.prh-blocked-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.prh-correction-hd {
  margin-bottom: 14px;
}

.prh-correction-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  margin-top: 8px;
}

.prh-correction-item-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.prh-divider {
  border: none;
  border-top: 1px dashed #e2e8f0;
  margin: 10px 0;
}

.personnel-lock-banner {
  border-color: #a7f3d0;
  background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 70%);
}

.personnel-card-preview .rl-card-face-container.personnel,
.personnel-card-preview .rl-card-face-container.personnel-back {
  width: 228px;
  aspect-ratio: 54 / 85.6;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  background: #f8fafc;
}

.personnel-card-preview .rl-card-face-container.personnel .rl-card-face-img,
.personnel-card-preview .rl-card-face-container.personnel-back .rl-card-face-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* =========================================================
   PERSONNEL DEFAULT / OLD CARD STYLE
   ========================================================= */
.personnel-card-preview .rl-card-face-container.personnel {
  width: 228px;
}

.personnel-card-ol-photo {
  position: absolute;
  top: 22.5%;
  left: 43%;
  width: 50.5%;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  overflow: hidden;
  background: #d1fae5;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .18);
}

.personnel-card-ol-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.personnel-card-ol-photo .rl-cp-ph-icon {
  font-size: 36px;
  color: #94a3b8;
}

.personnel-card-ol-perid,
.personnel-card-ol-hn,
.personnel-card-ol-name-th,
.personnel-card-ol-name-en,
.personnel-card-ol-position,
.personnel-card-ol-dept,
.personnel-card-ol-expiry {
  position: absolute;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: inherit;
}

.personnel-card-ol-perid {
  top: 51.5%;
  font-size: 10px;
  left: 62px;
  font-weight: 500;
}

.personnel-card-ol-hn {
  top: 59%;
  left: 52px;
  font-size: 10px;
  font-weight: 500;
}

.personnel-card-ol-name-th {
  top: 243px;
  left: 27px;
  right: 7%;
  bottom: 16.5%;
  text-align: left;
  font-size: 12px;
  font-weight: 800;
}

.personnel-card-ol-name-en {
  left: 27px;
  right: 7%;
  bottom: 24.5%;
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
}

.personnel-card-ol-position {
  top: 79%;
  left: 27px;
  right: 7%;
  text-align: left;
  font-size: 10px;
  font-weight: 500;
}

.personnel-card-ol-dept {
  top: 84%;
  left: 28px;
  right: 7%;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  max-height: 24px;
  line-height: 1.18;
  white-space: normal;
  text-overflow: clip;
  word-break: break-word;
  overflow: hidden;
}

.personnel-card-ol-expiry {
  top: 336px;
  left: 6%;
  right: auto;
  bottom: 3.8%;
  font-size: 10px;
  font-weight: 500;
}

/* =========================================================
   PERSONNEL RENEWAL / NEW REDESIGNED STYLE (SCOPED UNDER .new-layout)
   ========================================================= */
.personnel-card-preview .rl-card-face-container.personnel-back {
  width: 228px;
  aspect-ratio: 54 / 85.6;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  background: #f8fafc;
}

.personnel-card-preview .rl-card-face-container.personnel.new-layout,
.personnel-card-preview .rl-card-face-container.personnel-back.new-layout {
  width: 228px;
  aspect-ratio: 54 / 85.6;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  background: #f8fafc;
}

.personnel-card-preview .rl-card-face-container.personnel.new-layout .rl-card-face-img,
.personnel-card-preview .rl-card-face-container.personnel-back.new-layout .rl-card-face-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Front Card - Circle Photo Overlay (Renewal Only) */
.new-layout .personnel-card-ol-photo {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 65.5%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
  /* border: 1px solid rgba(255, 255, 255, 0.6); */
  z-index: 2;
}

.new-layout .personnel-card-ol-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.new-layout .personnel-card-ol-photo .rl-cp-ph-icon {
  font-size: 32px;
  color: #94a3b8;
}

/* Front Card - Text Elements (Renewal Only) */
.new-layout .personnel-card-ol-name-th,
.new-layout .personnel-card-ol-name-en,
.new-layout .personnel-card-ol-position,
.new-layout .personnel-card-ol-dept {
  position: absolute;
  left: 10px;
  right: 10px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'Kanit', sans-serif;
  z-index: 3;
}

.new-layout .personnel-card-ol-name-th {
  top: 65.5%;
  font-size: 14.5px;
  font-weight: 700;
  color: #0c4a34;
  /* Rich premium dark green matching Faculty of Medicine logo */
  letter-spacing: -0.01em;
}

.new-layout .personnel-card-ol-name-en {
  top: 72.5%;
  font-size: 11.5px;
  font-weight: 600;
  color: #1e293b;
  /* Premium slate dark grey */
  letter-spacing: 0.01em;
}

.new-layout .personnel-card-ol-position {
  top: 81.5%;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: normal;
  text-overflow: clip;
  overflow: visible;
  word-break: break-word;
  font-size: 12px;
  font-weight: 900;
  color: #111827;
  line-height: 1.1;
}

.new-layout .personnel-card-ol-dept {
  top: 87.5%;
  height: 33px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: normal;
  text-overflow: clip;
  overflow: hidden;
  word-break: break-word;
  font-size: 12px;
  font-weight: 100;
  color: #111827;
  line-height: 1.1;
}

.personnel-card-preview .personnel-card-ol-dept {
  white-space: normal;
  text-overflow: clip;
  word-break: break-word;
  overflow: hidden;
}

/* Back Card - Values (overlay on pre-printed label templates) */
.personnel-card-back-ol-perid,
.personnel-card-back-ol-hn,
.personnel-card-back-ol-expiry {
  position: absolute;
  right: 9px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'Kanit', sans-serif;
  z-index: 3;
}

.personnel-card-back-ol-perid {
  top: 48%;
  font-size: 14px;
  font-weight: 900;
  color: darkgoldenrod;
}

.personnel-card-back-ol-hn {
  top: 63%;
  font-size: 14px;
  font-weight: 900;
  color: darkgoldenrod;
}

.personnel-card-back-ol-expiry {
  top: 79%;
  font-size: 11.5px;
  /* font-weight: 700;
  color: #0c4a34; */
  /* Green matching PSU style */
}

/* =========================================================
   ENTREPRENEUR LANDING + PREVIEW
   ========================================================= */
.ent-landing {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.ent-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: 22px;
  padding: 28px;
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, #7f1d1d 0%, #b91c1c 48%, #fecaca 120%);
  color: #fff;
  box-shadow: 0 24px 56px rgba(127, 29, 29, .18);
}

.ent-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ent-hero-kicker {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .78;
}

.ent-hero-title {
  font-size: 32px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -.03em;
}

.ent-hero-sub {
  font-size: 15px;
  line-height: 1.75;
  color: rgba(255, 255, 255, .9);
}

.ent-hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ent-hero-points span {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .18);
  font-size: 12px;
  font-weight: 600;
}

.ent-hero-media {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.ent-hero-image {
  width: min(100%, 320px);
  border-radius: 24px;
  display: block;
  box-shadow: 0 18px 36px rgba(15, 23, 42, .22);
  border: 1px solid rgba(255, 255, 255, .26);
}

.ent-hero-caption {
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .84);
  text-align: center;
  max-width: 300px;
}

.ent-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.ent-mode-card {
  --accent: #dc2626;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 188px;
  padding: 22px 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform .24s var(--ease-spring), box-shadow .24s, border-color .24s;
  font-family: inherit;
}

.ent-mode-card.mode-new {
  --accent: #dc2626;
}

.ent-mode-card.mode-lost {
  --accent: #d97706;
}

.ent-mode-card.mode-renew {
  --accent: #15803d;
}

.ent-mode-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 16px 36px rgba(15, 23, 42, .10);
}

.ent-mode-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(148, 163, 184, .18);
}

.ent-mode-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: #fef2f2;
}

.ent-mode-card.mode-lost .ent-mode-icon {
  background: #fffbeb;
}

.ent-mode-card.mode-renew .ent-mode-icon {
  background: #f0fdf4;
}

.ent-mode-label {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-1);
}

.ent-mode-desc {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-3);
}

.ent-lookup-panel {
  padding: 24px;
  border-radius: var(--r-xl);
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ent-lookup-panel.is-muted {
  background: linear-gradient(180deg, #fff8f8 0%, #ffffff 100%);
  border-color: #fecaca;
}

.ent-lookup-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ent-lookup-kicker {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #b91c1c;
  margin-bottom: 6px;
}

.ent-lookup-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1.2;
}

.ent-lookup-sub {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-2);
}

.ent-lookup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ent-lookup-alert {
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  line-height: 1.6;
}

.ent-lookup-alert.success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.ent-lookup-alert.error {
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
}

.ent-new-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-radius: var(--r-lg);
  background: #fff;
  border: 1px solid #fecaca;
}

.ent-new-cta-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 4px;
}

.ent-new-cta-sub {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.6;
}

.ent-result-card {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) auto;
  gap: 16px;
  padding: 18px;
  border-radius: var(--r-lg);
  border: 1px solid #fecaca;
  background: linear-gradient(180deg, #fff7f7 0%, #ffffff 100%);
}

.ent-result-photo {
  position: relative;
  width: 90px;
  height: 110px;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #fecaca;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ent-result-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ent-result-photo-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  color: var(--text-3);
}

.ent-result-photo img+.ent-result-photo-fallback {
  display: none;
}

.ent-result-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ent-result-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-1);
}

.ent-result-meta {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
}

.ent-result-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

/* ---- Entrepreneur History Section ---- */
.ent-history-section {
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.ent-history-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 16px 22px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  text-align: left;
  transition: background .18s;
}

.ent-history-toggle:hover {
  background: #fef2f2;
}

.ent-history-toggle-icon {
  font-size: 18px;
}

.ent-history-toggle-label {
  flex: 1;
}

.ent-history-toggle-caret {
  font-size: 12px;
  color: var(--text-3);
}

.ent-history-body {
  padding: 0 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-top: 1px solid var(--border);
}

.ent-history-sub {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-2);
  padding-top: 16px;
  margin: 0;
}

.ent-hist-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ent-hist-results-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  padding: 8px 0 2px;
  border-top: 1px solid var(--border);
}

.ent-hist-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: #fafafa;
  transition: border-color .15s;
}

.ent-hist-row.is-open {
  border-color: var(--primary);
  background: #fff;
}

.ent-hist-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ent-hist-row-wish {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
}

.ent-hist-detail-btn {
  margin-left: auto;
  flex-shrink: 0;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: transparent;
  border: 1px solid var(--primary);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
}

.ent-hist-detail-btn:hover {
  background: var(--primary);
  color: #fff;
}

.ent-hist-row-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}

.ent-hist-row-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}

.ent-hist-row-attach {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.ent-hist-detail-panel {
  margin-top: 10px;
  padding: 14px 0 2px 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ent-hist-detail-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ent-hist-detail-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 4px;
}

.ent-hist-info-row {
  display: flex;
  gap: 8px;
  font-size: 13px;
  line-height: 1.6;
}

.ent-hist-info-label {
  min-width: 140px;
  flex-shrink: 0;
  color: var(--text-3);
  font-size: 12px;
}

.ent-hist-info-val {
  color: var(--text-1);
  font-weight: 500;
}

.ent-hist-attach-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.ent-hist-attach {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  text-decoration: none;
  transition: background .15s;
}

.ent-hist-attach:hover {
  background: #fee2e2;
}

/* ---- End Entrepreneur History Section ---- */

.ent-card-preview-section {
  margin: 0 0 24px 0;
}

.ent-card-preview-heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 2px;
}

.ent-card-preview-desc {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 14px;
}

.ent-card-preview-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.ent-card-preview-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.ent-card-preview-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.ent-card-face-container {
  position: relative;
  width: 220px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .18);
}

.ent-card-face-img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
}

.ent-card-ol-shop-role {
  position: absolute;
  top: 30%;
  left: 20%;
  width: 38%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  text-align: right;
  color: #0f172a;
}

.ent-card-ol-shop-name {
  position: absolute;
  top: 26%;
  left: -11%;
  width: 50%;
  height: 28%;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  text-align: right;
  color: #111827;
}

.ent-card-ol-photo {
  position: absolute;
  top: 27%;
  right: 13px;
  width: 47%;
  aspect-ratio: 13 / 15;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ent-card-ol-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ent-cp-ph-icon {
  font-size: 34px;
  color: #475569;
}

.ent-card-ol-owner {
  position: absolute;
  top: 65.4%;
  left: 2%;
  right: 2%;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-align: right;
  color: #0f172a;
  white-space: nowrap;
  overflow: visible;
}

.ent-card-ol-expiry {
  position: absolute;
  top: 86.4%;
  left: 30%;
  right: 8%;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: right;
  color: #0f172a;
  white-space: nowrap;
}

@media (max-width: 960px) {

  .student-hero-card,
  .student-upload-panel {
    grid-template-columns: 1fr;
  }

  .student-profile-card,
  .student-access-card,
  .student-request-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .student-profile-side {
    text-align: left;
  }

  .student-profile-alert-side {
    min-width: 0;
    align-items: flex-start;
  }

  .ent-hero-card {
    grid-template-columns: 1fr;
  }

  .ent-mode-grid {
    grid-template-columns: 1fr;
  }

  .ent-result-card {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .ent-result-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {

  .student-hero-card,
  .student-profile-card,
  .student-access-card {
    padding: 20px;
  }

  .student-hero-title {
    font-size: 26px;
  }

  .student-profile-name {
    font-size: 20px;
  }

  .ent-hero-card,
  .ent-lookup-panel {
    padding: 20px;
  }

  .ent-hero-title {
    font-size: 26px;
  }

  .ent-new-cta,
  .ent-lookup-head {
    flex-direction: column;
    align-items: stretch;
  }

  .ent-card-preview-row {
    justify-content: center;
    gap: 12px;
  }

  .ent-card-face-container {
    width: 162px;
  }

  .ent-card-ol-shop-role {
    font-size: 9px;
  }

  .ent-card-ol-owner,
  .ent-card-ol-expiry {
    font-size: 11px;
  }
}

/* ---- Form Step Enhancements (Relative) ---- */
.rl-mode-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.rl-mode-new {
  background: var(--purple-light);
  color: var(--purple-dark);
}

.rl-mode-renew {
  background: var(--green-light);
  color: var(--green-dark);
}

.rl-mode-lost {
  background: var(--yellow-light);
  color: var(--yellow-dark);
}

.rl-correction-banner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
  padding: 18px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%);
  border: 1px solid #fdba74;
}

.rl-correction-banner-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.rl-correction-banner-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
  color: #c2410c;
  margin-bottom: 4px;
}

.rl-correction-banner-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-1);
}

.rl-correction-request-id {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 12px;
  font-weight: 700;
}

.rl-correction-banner-note {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.65;
}

.rl-prefill-note {
  background: var(--blue-light);
  color: var(--blue-dark);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid #93c5fd;
}

.rl-prefill-note strong {
  display: inline-block;
  margin-right: 6px;
}

.rl-inline-lock-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  font-size: 13px;
  line-height: 1.55;
}

/* Vehicle/gate box */
.rl-dorm-gate-box {
  margin-top: 20px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
}

.rl-dorm-gate-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
}

.rl-dorm-gate-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 14px;
}

/* Staff info card (step 2 — ข้อมูลบุคลากรที่เกี่ยวข้อง) */
.rl-staff-info-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-radius: var(--r-xl);
  padding: 18px 22px;
  border: 1.5px solid #93c5fd;
  margin-bottom: 16px;
}

.rl-staff-avatar {
  font-size: 38px;
  flex-shrink: 0;
}

.rl-staff-detail {
  flex: 1;
}

.rl-staff-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
}

.rl-staff-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.rl-staff-perid {
  font-size: 12px;
  font-weight: 600;
  background: #bfdbfe;
  color: #1e40af;
  padding: 2px 8px;
  border-radius: 100px;
  font-family: var(--font-mono, monospace);
}

.rl-staff-pos {
  font-size: 12px;
  color: #1d4ed8;
}

.rl-staff-dept {
  font-size: 12px;
  color: var(--text-3);
}

/* Dorm info card (step 2) */
.rl-dorm-info-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-radius: var(--r-xl);
  padding: 24px;
  border: 1.5px solid #bbf7d0;
  margin-bottom: 8px;
}

.rl-dorm-icon {
  font-size: 42px;
  flex-shrink: 0;
}

.rl-dorm-detail {
  flex: 1;
}

.rl-dorm-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--green-dark);
  font-weight: 700;
  margin-bottom: 8px;
}

.rl-dorm-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.rl-dorm-key {
  font-size: 13px;
  color: #166534;
  min-width: 60px;
}

.rl-dorm-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
}

.rl-no-dorm-warn {
  background: var(--yellow-light);
  border: 1.5px solid #fcd34d;
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--yellow-dark);
  margin-top: 8px;
}

/* Attachment list (step 3) */
.rl-attach-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.rl-attach-item {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
}

.rl-attach-optional {
  border-style: dashed;
  opacity: .85;
}

.rl-attach-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.rl-attach-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--purple-main);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.rl-attach-num-opt {
  background: var(--border);
  color: var(--text-3);
}

.rl-attach-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 3px;
}

.rl-attach-hint {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}

.rl-optional-badge {
  background: var(--bg);
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 10px;
  padding: 1px 8px;
  font-weight: 500;
  margin-left: 6px;
  vertical-align: middle;
}

/* Proof upload card (personnel / relative upload panel) */
.rl-proof-card {
  padding: 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rl-proof-head {}

.rl-proof-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 3px;
}

.rl-proof-sub {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.6;
}

/* Upload box (label styled as a button) */
.rl-upload-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px 12px;
  border-radius: var(--r-md);
  border: 2px dashed #60a5fa;
  background: #eff6ff;
  cursor: pointer;
  text-align: center;
  transition: border-color .2s, background .2s;
  user-select: none;
}

.rl-upload-box:hover {
  border-color: #2563eb;
  background: #dbeafe;
}

.rl-upload-icon {
  font-size: 26px;
}

.rl-upload-title {
  font-size: 13px;
  font-weight: 700;
  color: #1d4ed8;
}

.rl-upload-sub {
  font-size: 11px;
  color: var(--text-3);
}

/* File drop zone */
.rl-file-drop {
  border: 2px dashed var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--surface);
}

.rl-file-drop:hover {
  border-color: var(--purple-main);
  background: #f5f3ff;
}

.rl-file-drop-icon {
  font-size: 28px;
  margin-bottom: 6px;
}

.rl-file-drop-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 4px;
}

.rl-file-drop-hint {
  font-size: 12px;
  color: var(--text-3);
}

/* File preview */
.rl-file-preview {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--green-light);
  border-radius: var(--r-md);
  border: 1px solid #bbf7d0;
}

.rl-prev-photo {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}

.rl-remove-file {
  margin-left: auto;
  background: none;
  border: 1px solid #dc2626;
  color: #dc2626;
  border-radius: var(--r-sm);
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: opacity .15s;
  font-family: var(--font-thai);
}

.rl-remove-file:hover {
  opacity: .75;
}

/* Keep/new photo choice */
.rl-existing-photo {
  margin-bottom: 12px;
}

.rl-choice-box {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: #f8fafc;
}

.rl-choice-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 8px;
}

.rl-photo-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.rl-radio-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #d7dee9;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
  transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}

.rl-radio-label:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.rl-radio-label:has(input:checked) {
  border-color: #1d4ed8;
  background: #eff6ff;
  color: #1e3a8a;
  box-shadow: 0 10px 22px rgba(29, 78, 216, .12);
}

.rl-radio-label input {
  accent-color: #1d4ed8;
}

.rl-existing-proof {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: #fff;
}

.rl-existing-proof-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.rl-existing-proof-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
}

.rl-existing-proof-link {
  color: var(--psu-blue);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.rl-existing-proof-link:hover {
  text-decoration: underline;
}

.rl-existing-proof-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rl-prev-proof {
  width: min(280px, 100%);
  height: auto;
}

.rl-existing-proof-file {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: #f8fafc;
  color: var(--text-2);
  font-size: 13px;
}

.rl-existing-proof-file a {
  color: var(--psu-blue);
  font-weight: 600;
  text-decoration: none;
}

.rl-existing-proof-file a:hover {
  text-decoration: underline;
}

/* =========================================================
   RESPONSIVE — Relative landing
   ========================================================= */
@media (max-width: 640px) {
  .rl-dorm-summary-card {
    flex-wrap: wrap;
  }

  .rl-dorm-summary-right {
    width: 100%;
    text-align: left;
  }

  .rl-card-grid {
    grid-template-columns: 1fr;
  }

  .rl-person-card {
    flex-wrap: wrap;
  }

  .rl-person-actions {
    flex-direction: row;
    width: 100%;
  }

  .rl-action-btn {
    flex: 1;
    text-align: center;
  }
}

/* Flip hint */
.cp-flip-hint {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 5px;
  animation: cpHintBounce 2s ease-in-out infinite;
}

.cp-flip-hint::before {
  content: '↕';
  font-size: 13px;
}

@keyframes cpHintBounce {

  0%,
  100% {
    transform: translateY(0);
    opacity: .7;
  }

  50% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

/* Info panel */
.cp-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cp-personnel-conditions {
  display: grid;
  gap: 12px;
}

.cp-condition-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  animation: cpConditionEnter .42s cubic-bezier(.22, 1, .36, 1) both;
}

.cp-condition-heading-icon,
.cp-condition-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.cp-condition-heading-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: #be185d;
  background: #fce7f3;
}

.cp-condition-heading-icon svg { width: 21px; height: 21px; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.cp-condition-heading strong { display: block; color: #172033; font-size: 16px; line-height: 1.35; }
.cp-condition-heading small { display: block; margin-top: 2px; color: #8290a8; font-size: 11px; }

.cp-condition-group {
  padding: 15px 16px;
  border: 1px solid;
  border-radius: 8px;
  animation: cpConditionEnter .46s cubic-bezier(.22, 1, .36, 1) both;
  transition: transform .22s ease, box-shadow .22s ease;
}

.cp-condition-group:nth-child(2) { animation-delay: .08s; }
.cp-condition-group:nth-child(3) { animation-delay: .16s; }
.cp-condition-group:hover { transform: translateY(-2px); box-shadow: 0 9px 22px rgba(15, 23, 42, .08); }
.cp-condition-free { color: #087443; border-color: #9ee7c2; background: #effcf5; }
.cp-condition-paid { color: #b84418; border-color: #fed09b; background: #fff8ef; }

.cp-condition-group-head { display: flex; align-items: center; gap: 10px; }
.cp-condition-group-head strong { display: block; font-size: 14px; line-height: 1.3; }
.cp-condition-group-head small { display: block; margin-top: 1px; font-size: 10px; opacity: .78; }
.cp-condition-icon { width: 30px; height: 30px; border-radius: 7px; background: rgba(255,255,255,.78); }
.cp-condition-icon svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cp-condition-group ul { display: grid; gap: 5px; margin: 11px 0 0; padding: 0; list-style: none; }
.cp-condition-group li { position: relative; padding-left: 15px; color: #435168; font-size: 12px; line-height: 1.45; transition: transform .18s ease; }
.cp-condition-group li::before { content: ''; position: absolute; left: 1px; top: .58em; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.cp-condition-group li:hover { transform: translateX(3px); }
.cp-condition-payment { margin: 11px 0 0; padding-top: 10px; border-top: 1px solid rgba(184,68,24,.16); color: #c84c1d; font-size: 10.5px; font-weight: 700; line-height: 1.45; }

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

@media (prefers-reduced-motion: reduce) {
  .cp-condition-heading,
  .cp-condition-group { animation: none; }
  .cp-condition-group,
  .cp-condition-group li { transition: none; }
}

.cp-info-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-3);
}

.cp-info-desc {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.75;
}

.cp-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.cp-feat {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
}

.cp-feat-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
  color: white;
}

/* check color per theme */
.cp-theme-personnel .cp-feat-check {
  background: var(--green-main);
}

.cp-theme-relative .cp-feat-check {
  background: var(--yellow-dark);
}

.cp-theme-student .cp-feat-check {
  background: var(--blue-main);
}

.cp-theme-entrepreneur .cp-feat-check {
  background: var(--red-main);
}

/* Actions */
.cp-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  gap: 12px;
}

/* Start button */
.btn-start {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 30px;
  border-radius: var(--r-md);
  border: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .25s var(--ease-spring), box-shadow .25s;
}

.btn-start::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, .22) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: btnShimmer 2.2s ease-in-out infinite;
}

@keyframes btnShimmer {

  0%,
  40% {
    transform: translateX(-100%);
  }

  60%,
  100% {
    transform: translateX(140%);
  }
}

.btn-start:hover {
  transform: translateY(-3px) scale(1.04);
}

.btn-start:active {
  transform: translateY(0) scale(.97);
}

.cp-start-personnel {
  background: linear-gradient(135deg, var(--green-dark), var(--green-main));
  box-shadow: 0 6px 20px var(--green-glow);
}

.cp-start-relative {
  background: linear-gradient(135deg, var(--yellow-dark), var(--yellow-main));
  box-shadow: 0 6px 20px var(--yellow-glow);
}

.cp-start-student {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue-main));
  box-shadow: 0 6px 20px var(--blue-glow);
}

.cp-start-entrepreneur {
  background: linear-gradient(135deg, var(--red-dark), var(--red-main));
  box-shadow: 0 6px 20px rgba(239, 68, 68, .30);
}

.cp-start-rocket {
  font-size: 18px;
  display: inline-block;
  animation: rocketBounce 1.4s ease-in-out infinite;
}

@keyframes rocketBounce {

  0%,
  100% {
    transform: translateY(0) rotate(-45deg);
  }

  50% {
    transform: translateY(-4px) rotate(-45deg);
  }
}

/* Responsive */
@media (max-width: 680px) {
  .cp-box {
    padding: 24px 18px;
    border-radius: var(--r-lg);
  }

  .cp-body {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .cp-title {
    font-size: 22px;
  }

  .card-3d-wrap {
    max-width: 260px;
  }

  .cp-actions {
    flex-wrap: wrap;
  }

  .btn-start {
    width: 100%;
    justify-content: center;
  }
}

/* Thai Date Picker (พ.ศ.) */
.thai-dp {
  width: 100%;
}

.thai-dp-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.thai-dp-row .field-select {
  margin: 0;
}

.thai-dp-d {
  width: 72px;
  min-width: 72px;
  flex-shrink: 0;
}

.thai-dp-m {
  flex: 1;
  min-width: 110px;
}

.thai-dp-y {
  width: 96px;
  min-width: 96px;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .thai-dp-row {
    flex-wrap: wrap;
  }

  .thai-dp-d,
  .thai-dp-m,
  .thai-dp-y {
    width: 100%;
    min-width: 0;
    flex-shrink: 1;
  }
}

/* =========================================================
   CARD STATUS BANNER (Dynamic Expiry Info)
   ========================================================= */
.card-status-banner {
  margin-top: 16px;
  margin-bottom: 16px;
  padding: 18px 22px;
  border-radius: var(--r-xl);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
  overflow: hidden;
  animation: cardBannerSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  transition: box-shadow 0.3s, border-color 0.3s;
}

.card-status-banner:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

@keyframes cardBannerSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Icon circle */
.card-status-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
}

.card-status-banner:hover .card-status-icon {
  transform: scale(1.08);
}

/* Main content */
.card-status-body {
  flex: 1;
  min-width: 0;
}

.card-status-kicker {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 3px;
}

.card-status-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 2px;
}

.card-status-date {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.card-status-sub {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}

/* Badge */
.card-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* ── Progress Bar ─────────────────────────────────────── */
.card-expiry-progress {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
  margin-top: 4px;
}

.card-expiry-progress-fill {
  height: 100%;
  border-radius: 999px;
  animation: progressFillIn 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  transform-origin: left;
}

@keyframes progressFillIn {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

/* ── State: Active (Green) ─────────────────────────────── */
.card-status-banner.csb-active {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 40%, #ffffff 100%);
  border-color: #86efac;
}

.card-status-banner.csb-active .card-status-icon {
  background: #16a34a;
  color: #fff;
}

.card-status-banner.csb-active .card-status-kicker {
  color: #15803d;
}

.card-status-banner.csb-active .card-status-date {
  color: #166534;
}

.card-status-banner.csb-active .card-status-badge {
  background: #dcfce7;
  color: #15803d;
}

.card-status-banner.csb-active .card-expiry-progress-fill {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

/* ── State: Expiring Soon (Amber) ──────────────────────── */
.card-status-banner.csb-expiring {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 30%, #ffffff 100%);
  border-color: #fcd34d;
}

.card-status-banner.csb-expiring .card-status-icon {
  background: #d97706;
  color: #fff;
  animation: pulseGlow 2s ease-in-out infinite;
}

.card-status-banner.csb-expiring .card-status-kicker {
  color: #b45309;
}

.card-status-banner.csb-expiring .card-status-date {
  color: #92400e;
}

.card-status-banner.csb-expiring .card-status-badge {
  background: #fef3c7;
  color: #92400e;
  animation: pulseGlow 2s ease-in-out infinite;
}

.card-status-banner.csb-expiring .card-expiry-progress-fill {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

/* ── State: Expired (Red) ──────────────────────────────── */
.card-status-banner.csb-expired {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 30%, #ffffff 100%);
  border-color: #fca5a5;
}

.card-status-banner.csb-expired .card-status-icon {
  background: #dc2626;
  color: #fff;
  animation: pulseGlow 1.5s ease-in-out infinite;
}

.card-status-banner.csb-expired .card-status-kicker {
  color: #b91c1c;
}

.card-status-banner.csb-expired .card-status-date {
  color: #991b1b;
}

.card-status-banner.csb-expired .card-status-badge {
  background: #fee2e2;
  color: #991b1b;
  animation: pulseGlow 1.5s ease-in-out infinite;
}

.card-status-banner.csb-expired .card-expiry-progress-fill {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* ── State: Renewing (Blue shimmer) ────────────────────── */
.card-status-banner.csb-renewing {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 30%, #ffffff 100%);
  border-color: #93c5fd;
}

.card-status-banner.csb-renewing .card-status-icon {
  background: #2563eb;
  color: #fff;
}

.card-status-banner.csb-renewing .card-status-kicker {
  color: #1d4ed8;
}

.card-status-banner.csb-renewing .card-status-date {
  color: #1e40af;
}

.card-status-banner.csb-renewing .card-status-badge {
  background: #dbeafe;
  color: #1e40af;
}

.card-status-banner.csb-renewing .card-expiry-progress-fill {
  background: linear-gradient(90deg, #60a5fa, #3b82f6);
  animation: shimmerSlide 2s linear infinite;
  background-size: 200% 100%;
}

/* ── State: Renewed (Teal success) ─────────────────────── */
.card-status-banner.csb-renewed {
  background: linear-gradient(135deg, #ecfeff 0%, #cffafe 25%, #ffffff 100%);
  border-color: #67e8f9;
}

.card-status-banner.csb-renewed .card-status-icon {
  background: #0891b2;
  color: #fff;
}

.card-status-banner.csb-renewed .card-status-kicker {
  color: #0e7490;
}

.card-status-banner.csb-renewed .card-status-date {
  color: #155e75;
}

.card-status-banner.csb-renewed .card-status-badge {
  background: #cffafe;
  color: #0e7490;
}

.card-status-banner.csb-renewed .card-expiry-progress-fill {
  background: linear-gradient(90deg, #22d3ee, #06b6d4);
}

/* ── Animations ────────────────────────────────────────── */
@keyframes pulseGlow {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.82;
    transform: scale(1.04);
  }
}

@keyframes shimmerSlide {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 640px) {
  .card-status-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
  }

  .card-status-badge {
    align-self: flex-start;
  }
}

/* ── Photo Choice & Preview Layout (Lost/Damaged Card Flow) ── */
.photo-choice-toggle-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 15px 0 20px 0;
}

.photo-choice-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
}

.photo-choice-label .req {
  color: var(--red-main);
  margin-left: 2px;
}

.segmented-control {
  display: flex;
  background: var(--bg);
  padding: 4px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  width: fit-content;
  gap: 4px;
}

.segmented-btn {
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  padding: 8px 18px;
  border-radius: calc(var(--r-md) - 4px);
  cursor: pointer;
  transition: all .2s var(--ease);
  white-space: nowrap;
}

.segmented-btn:hover {
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.4);
}

.segmented-btn.active {
  background: var(--surface);
  color: var(--psu-blue-mid);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

/* Photo Keep Preview styling */
.photo-keep-preview-wrapper {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--r-md);
  border: 1px dashed var(--border);
  margin-top: 8px;
}

@media (max-width: 576px) {
  .photo-keep-preview-wrapper {
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: 12px;
  }
}

.photo-keep-avatar {
  width: 110px;
  height: 147px;
  /* 3:4 aspect ratio for passport-style photo */
  border-radius: var(--r-sm);
  border: 2px solid var(--white);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  flex-shrink: 0;
  transition: transform 0.3s var(--ease-spring);
}

.photo-keep-avatar:hover {
  transform: scale(1.05);
}

.photo-keep-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-keep-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.photo-keep-badge {
  display: inline-flex;
  align-items: center;
  background: var(--green-light);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  width: fit-content;
  gap: 4px;
}

@media (max-width: 576px) {
  .photo-keep-badge {
    margin: 0 auto;
  }
}

.photo-keep-text {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
  line-height: 1.4;
}

/* =========================================================
   PROFILE CHANGE ONLY FLOW (WISH ID 5)
   ========================================================= */
.personnel-profile-sync-option {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  margin: 20px 0;
  padding: 18px 20px;
  border: 1px solid #93c5fd;
  border-radius: 10px;
  background: #eff6ff;
  cursor: pointer;
}

.student-qr-grid {
  display: grid;
  grid-template-columns: repeat(21, 1fr);
  width: 100%;
  aspect-ratio: 1;
  background: #fff;
}

.student-qr-grid i {
  display: block;
  background: #fff;
}

.student-qr-grid i.dark {
  background: #07111f;
}

.personnel-profile-sync-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.personnel-profile-sync-check {
  grid-column: 1;
  display: flex;
  pointer-events: none;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border: 2px solid #94a3b8;
  border-radius: 6px;
  background: #fff;
  color: transparent;
  font-size: 15px;
  font-weight: 800;
}

.personnel-profile-sync-option input:checked + .personnel-profile-sync-check {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.personnel-profile-sync-option:focus-within {
  outline: 3px solid rgba(37, 99, 235, 0.2);
  outline-offset: 2px;
}

.personnel-profile-sync-content {
  grid-column: 2;
  min-width: 0;
}

.personnel-profile-sync-content strong,
.personnel-profile-sync-content small {
  display: block;
}

.personnel-profile-sync-content strong {
  color: #1e3a8a;
  font-size: 15px;
}

.personnel-profile-sync-content small {
  margin-top: 4px;
  color: #475569;
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 576px) {
  .personnel-profile-sync-option {
    grid-template-columns: 24px minmax(0, 1fr);
    padding: 16px;
  }

  .personnel-profile-sync-check {
    grid-column: 1;
  }

  .personnel-profile-sync-content {
    grid-column: 2;
  }
}

.profile-sync-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--bg-1, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--r-xl, 16px);
  padding: 24px;
  margin: 20px 0;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.05));
}

.profile-sync-warning-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 14px 18px;
  color: #78350f;
  font-size: 14px;
  line-height: 1.6;
  text-align: left;
}

.profile-sync-warning-banner .warning-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.profile-sync-comparison {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.profile-sync-card {
  flex: 1;
  min-width: 240px;
  max-width: 280px;
  background: var(--white, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.profile-sync-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.profile-sync-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 20px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.badge-current {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.badge-new {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.profile-sync-avatar-container {
  width: 160px;
  height: 200px;
  aspect-ratio: 4 / 5;
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.04);
}

.profile-sync-card.current .profile-sync-avatar-container {
  border-style: solid;
  border-color: #cbd5e1;
}

.profile-sync-card.new .profile-sync-avatar-container {
  border-color: #0284c7;
}

.profile-sync-avatar-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-avatar-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 13px;
  color: #94a3b8;
  font-weight: 600;
  text-align: center;
  line-height: 1.5;
}

.profile-avatar-placeholder i,
.profile-avatar-placeholder span {
  font-size: 32px;
}

.profile-sync-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--white, #fff);
  border: 1.5px solid var(--border, #e2e8f0);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.profile-sync-arrow .arrow-icon {
  font-size: 20px;
  color: #64748b;
}

.profile-sync-meta {
  text-align: center;
  width: 100%;
}

.profile-meta-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1, #1e293b);
  margin-bottom: 4px;
}

.profile-meta-dept {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3, #64748b);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-sync-upload-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.profile-sync-upload-wrapper .rl-upload-box {
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .profile-sync-comparison {
    flex-direction: column;
    gap: 16px;
  }

  .profile-sync-arrow {
    transform: rotate(90deg);
  }
}

/* --- Premium Stepper System for Personnel History --- */
.prh-stepper-container {
  margin: 18px 0;
  padding: 12px 16px;
  background: var(--bg-soft, #f8fafc);
  border-radius: 12px;
  border: 1px solid var(--border, #e2e8f0);
  width: 100%;
}

.prh-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  width: 100%;
}

.prh-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  flex-basis: 80px;
  text-align: center;
}

.prh-step-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.prh-step-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  margin-top: 6px;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.prh-step-line {
  flex-grow: 1;
  height: 3px;
  background: #cbd5e1;
  margin: 0 -15px;
  transform: translateY(-10px);
  position: relative;
  z-index: 1;
  border-radius: 2px;
  transition: all 0.4s ease;
}

/* Completed Step State */
.prh-step.completed .prh-step-icon {
  background: #22c55e;
  border-color: #22c55e;
  color: white;
  box-shadow: 0 4px 10px rgba(34, 197, 94, 0.3);
}

.prh-step.completed .prh-step-label {
  color: #15803d;
}

.prh-step-line.completed {
  background: #22c55e;
}

/* Active Step State */
.prh-step.active .prh-step-icon {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
  animation: stepPulse 2s infinite ease-in-out;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2), 0 4px 10px rgba(59, 130, 246, 0.3);
}

.prh-step.active .prh-step-label {
  color: #1d4ed8;
  font-weight: 800;
}

.prh-step-line.active-loading {
  background: linear-gradient(90deg, #3b82f6 50%, #cbd5e1 50%);
  background-size: 200% 100%;
  animation: lineFlow 1.5s infinite linear;
}

/* Correction (Editing) Step State */
.prh-step.active-editing .prh-step-icon {
  background: #f59e0b;
  border-color: #f59e0b;
  color: white;
  animation: stepPulseOrange 2s infinite ease-in-out;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2), 0 4px 10px rgba(245, 158, 11, 0.3);
}

.prh-step.active-editing .prh-step-label {
  color: #b45309;
  font-weight: 800;
}

/* Rejected Step State */
.prh-step.rejected .prh-step-icon {
  background: #ef4444;
  border-color: #ef4444;
  color: white;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.prh-step.rejected .prh-step-label {
  color: #b91c1c;
  font-weight: 800;
}

/* Step Animations */
@keyframes stepPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4), 0 4px 10px rgba(59, 130, 246, 0.3);
  }

  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 8px rgba(59, 130, 246, 0), 0 4px 10px rgba(59, 130, 246, 0.3);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0), 0 4px 10px rgba(59, 130, 246, 0.3);
  }
}

@keyframes stepPulseOrange {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4), 0 4px 10px rgba(245, 158, 11, 0.3);
  }

  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0), 0 4px 10px rgba(245, 158, 11, 0.3);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0), 0 4px 10px rgba(245, 158, 11, 0.3);
  }
}

@keyframes lineFlow {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

@media (max-width: 480px) {
  .prh-step-label {
    font-size: 9px;
  }

  .prh-step-icon {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
}

@media (max-width: 700px) {
  .student-access-actions {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .student-action-choice {
    min-height: 78px;
    grid-template-columns: 40px minmax(0, 1fr) 20px;
    gap: 12px;
    padding: 14px;
  }

  .student-action-icon {
    width: 40px;
    height: 40px;
    font-size: 21px;
  }

  .student-request-card {
    width: 100%;
    padding: 16px;
  }

  .student-request-card > .btn {
    width: 100%;
  }

  .student-request-main .prh-stepper-container {
    padding: 14px 16px;
  }

  .student-request-main .prh-stepper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .student-request-main .prh-step {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    text-align: left;
  }

  .student-request-main .prh-step-icon {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }

  .student-request-main .prh-step-label {
    width: auto;
    max-width: none;
    min-height: 0;
    margin: 0 0 0 12px;
    padding: 0;
    font-size: 12px;
    line-height: 1.45;
    text-align: left;
    white-space: normal;
  }

  .student-request-main .prh-step-line {
    width: 2px;
    min-width: 2px;
    height: 20px;
    margin: 3px 0 3px 15px;
    transform: none;
  }
}

/* Relative request progress and activity history */
.rl-request-progress {
  width: 100%;
}

.rl-request-progress .prh-stepper-container {
  box-sizing: border-box;
  margin: 4px 0 2px;
  padding: 14px 18px;
  overflow: hidden;
  border-radius: 8px;
  background: #f8fafc;
}

.rl-request-progress .prh-stepper {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) minmax(24px, .55fr) minmax(72px, 1fr) minmax(24px, .55fr) minmax(72px, 1fr) minmax(24px, .55fr) minmax(72px, 1fr);
  align-items: start;
}

.rl-request-progress .prh-step {
  min-width: 0;
  width: 100%;
  flex-basis: auto;
}

.rl-request-progress .prh-step-label {
  width: 100%;
  max-width: 112px;
  min-height: 34px;
  margin: 7px auto 0;
  padding: 0 2px;
  font-size: 11px;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}

.rl-request-progress .prh-step-line {
  width: calc(100% + 14px);
  min-width: 20px;
  margin: 15px -7px 0;
  transform: none;
}

.rl-hist-detail-panel .modal-info-section-title {
  margin-top: 18px;
}

.rl-hist-detail-panel .admin-approval-history,
.ent-hist-detail-panel .admin-approval-history {
  margin: 0;
  padding: 14px 0 0;
  border: 0;
  border-top: 1px solid #e2e8f0;
  border-radius: 0;
  background: transparent;
}

.ent-hist-detail-panel .modal-info-section-title {
  margin-top: 8px;
  margin-bottom: 0;
}

@media (max-width: 700px) {
  .rl-request-progress .prh-stepper-container {
    padding: 14px 16px;
  }

  .rl-request-progress .prh-stepper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .rl-request-progress .prh-step {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    text-align: left;
  }

  .rl-request-progress .prh-step-icon {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }

  .rl-request-progress .prh-step-label {
    width: auto;
    max-width: none;
    min-height: 0;
    margin: 0 0 0 12px;
    padding: 0;
    font-size: 12px;
    line-height: 1.45;
    text-align: left;
    white-space: normal;
  }

  .rl-request-progress .prh-step-line {
    width: 2px;
    min-width: 2px;
    height: 20px;
    margin: 3px 0 3px 15px;
    transform: none;
  }

  .admin-approval-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .admin-approval-head span {
    white-space: normal;
  }
}

/* --- Mobile Performance Optimization ---
   Disable heavy full-screen blur filters and infinite drifting animations on mobile and tablet screens (<1024px)
   to release GPU fill-rate bottleneck and ensure a butter-smooth 60 FPS experience. */
@media (max-width: 1024px) {

  .blob-yellow,
  .blob-red,
  .blob-green,
  .blob-blue-2,
  .bg-rings,
  .bg-ring,
  .bg-floats,
  .dots-grid {
    display: none !important;
    animation: none !important;
  }

  .page-bg::before,
  .page-bg::after {
    display: none !important;
    animation: none !important;
    filter: none !important;
  }

  .page-bg {
    background: linear-gradient(135deg, #f5f8ff 0%, #edf2f7 50%, #f7fafc 100%) !important;
    animation: none !important;
  }
}

/* --- Settings History Table Style --- */
.settings-history-table-container {
  max-width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--bg-card, #ffffff);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  margin-top: 16px;
}

.settings-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.settings-history-table thead tr {
  background: var(--bg-soft, #f8fafc);
  border-bottom: 2px solid var(--border, #e2e8f0);
}

.settings-history-table th {
  padding: 12px 16px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.settings-history-table tbody tr {
  border-bottom: 1px solid var(--border, #e2e8f0);
  transition: background-color 0.2s ease;
}

.settings-history-table tbody tr:last-child {
  border-bottom: none;
}

.settings-history-table tbody tr:hover {
  background-color: rgba(241, 245, 249, 0.5);
}

.settings-history-table td {
  padding: 14px 16px;
  color: #334155;
  vertical-align: middle;
}

.settings-history-date {
  white-space: nowrap;
  color: #64748b;
  font-size: 12px;
  font-family: monospace;
}

.settings-history-label {
  font-weight: 600;
  color: #0f172a;
}

.settings-history-value {
  font-size: 12.5px;
}

.settings-history-by {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: monospace;
  background: #f1f5f9;
  color: #475569;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

/* --- Admin Settings sub-tabs and grid fixes --- */
.sub-status-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  margin-bottom: 24px;
  width: fit-content;
  max-content: 100%;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
}
.sub-status-tabs::-webkit-scrollbar {
  display: none; /* Safari and Chrome */
}
.sub-status-tab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: #64748b;
  white-space: nowrap;
  font-family: inherit;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sub-status-tab:hover {
  background: rgba(255, 255, 255, 0.5);
  color: #0f172a;
}
.sub-status-tab.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* Grid & Input responsiveness for Rules Editor */
.settings-rules-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 0.8fr auto;
  gap: 12px;
  align-items: end;
  background: #f8fafc;
  padding: 16px;
  border-radius: 10px;
}
.settings-rules-grid input.settings-add-input {
  min-width: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  height: 38px !important;
}

.admin-settings-tabs {
  width: 100%;
}

.settings-page-stack {
  display: grid;
  gap: 16px;
}

.settings-page-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 20px;
  border-left: 4px solid #0f766e;
  background: #f8fafc;
  border-bottom: 1px solid #dbe3ee;
}

.settings-page-intro.expiry {
  border-left-color: #166534;
}

.settings-page-intro-copy {
  min-width: 0;
}

.settings-page-intro-stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: 0 0 auto;
  color: #64748b;
  font-size: 12px;
}

.settings-page-intro-stat strong {
  color: #0f172a;
  font-size: 28px;
  line-height: 1;
}

.settings-panel,
.maintenance-setting-card {
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
}

.settings-panel-header,
.maintenance-setting-head,
.settings-action-bar,
.maintenance-setting-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-panel-header h3,
.maintenance-setting-head h3 {
  margin: 3px 0 2px;
  color: #0f172a;
  font-size: 18px;
}

.settings-panel-header p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

.settings-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.settings-field-grid-campaign {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.settings-field-wide {
  grid-column: span 2;
}

.settings-field small,
.settings-row-meta {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 500;
}

.settings-field .settings-add-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.settings-input-suffix {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.settings-input-suffix b {
  color: #64748b;
  font-size: 12px;
}

.settings-textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  box-sizing: border-box;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-1);
  background: #fff;
  font: inherit;
  font-weight: 500;
}

.settings-textarea:focus {
  outline: none;
  border-color: var(--psu-blue-mid);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.settings-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  color: #166534;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.settings-switch.danger {
  color: #b91c1c;
}

.settings-switch input {
  width: 18px;
  height: 18px;
  accent-color: #16a34a;
}

.settings-switch.danger input {
  accent-color: #dc2626;
}

.settings-action-bar {
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  padding: 14px 16px;
  color: #475569;
  font-size: 12px;
}

.maintenance-settings-grid {
  display: grid;
  gap: 14px;
}

.maintenance-settings-group {
  margin-top: 22px;
}

.maintenance-settings-group-head {
  display: grid;
  grid-template-columns: minmax(180px, .45fr) 1fr;
  gap: 20px;
  align-items: baseline;
  margin-bottom: 8px;
  padding: 0 4px;
}

.maintenance-settings-group-head h3,
.maintenance-settings-group-head p {
  margin: 0;
}

.maintenance-settings-group-head h3 {
  color: #0f172a;
  font-size: 15px;
}

.maintenance-settings-group-head p {
  color: #64748b;
  font-size: 12px;
}

.maintenance-settings-list {
  border-top: 1px solid #dbe3ee;
}

.maintenance-setting-key {
  color: #64748b;
  font-family: monospace;
  font-size: 11px;
  font-weight: 700;
}

.maintenance-setting-card {
  padding: 0;
  border: 0;
  border-bottom: 1px solid #dbe3ee;
  border-radius: 0;
  box-shadow: none;
}

.maintenance-setting-head {
  list-style: none;
  padding: 15px 4px;
  cursor: pointer;
}

.maintenance-setting-head::-webkit-details-marker {
  display: none;
}

.maintenance-setting-head::after {
  content: '⌄';
  color: #94a3b8;
  font-size: 20px;
  transition: transform .2s ease;
}

.maintenance-setting-card[open] .maintenance-setting-head::after {
  transform: rotate(180deg);
}

.maintenance-setting-head:hover {
  background: #f8fafc;
}

.maintenance-setting-summary-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  color: #166534;
  font-size: 12px;
  font-weight: 700;
}

.maintenance-setting-summary-state span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
}

.maintenance-setting-summary-state.closed {
  color: #b45309;
}

.maintenance-setting-summary-state.closed span {
  background: #f59e0b;
}

.maintenance-setting-body {
  padding: 2px 4px 18px;
}

.maintenance-setting-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.maintenance-setting-toggle-row > div {
  display: grid;
  gap: 2px;
}

.maintenance-setting-toggle-row strong {
  color: #334155;
  font-size: 13px;
}

.maintenance-setting-toggle-row > div span {
  color: #64748b;
  font-size: 11px;
}

.maintenance-setting-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.maintenance-setting-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.settings-danger-btn {
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #be123c;
}

.empty-state.compact {
  padding: 24px;
}

@media (max-width: 768px) {
  .settings-rules-grid {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }
  .settings-rules-grid button {
    width: 100%;
  }

  .settings-panel,
  .maintenance-setting-card {
    padding: 16px;
  }

  .settings-panel-header,
  .maintenance-setting-head,
  .settings-action-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-field-grid,
  .settings-field-grid-campaign,
  .maintenance-setting-fields {
    grid-template-columns: 1fr;
  }

  .settings-field-wide {
    grid-column: auto;
  }

  .settings-action-bar .btn {
    width: 100%;
  }

  .settings-page-intro,
  .maintenance-setting-toggle-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-page-intro-stat {
    align-self: stretch;
    justify-content: flex-start;
  }

  .maintenance-settings-group-head {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .maintenance-setting-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .maintenance-setting-summary-state {
    margin-left: 0;
  }
}

/* Contact Info Card */
.contact-info-card {
  margin: 32px auto 0;
  max-width: 1160px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid var(--psu-blue-light);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  padding: 24px 28px;
  text-align: left;
  animation: fadeSlideUp .6s var(--ease) 1s both;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.contact-info-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--psu-blue-mid);
}
.contact-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--psu-blue);
  margin-bottom: 16px;
  border-bottom: 1.5px dashed var(--psu-blue-light);
  padding-bottom: 10px;
}
.contact-card-title svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.contact-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}
.contact-card-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.contact-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}
.contact-item-header.personnel {
  color: var(--psu-blue-mid);
}
.contact-item-header.student {
  color: var(--blue-main);
}
.contact-item-header.other {
  color: var(--yellow-dark);
}
.contact-item-body {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}
.contact-item-body a {
  color: var(--psu-blue-mid);
  text-decoration: none;
  font-weight: 500;
}
.contact-item-body a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .contact-card-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Maintenance View & Cards */
#view-maintenance {
  display: none;
  background: var(--bg);
  min-height: 100vh;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  box-sizing: border-box;
}
#view-maintenance.active {
  display: flex;
}
.maintenance-container {
  width: 100%;
  max-width: 640px;
  animation: fadeSlideUp 0.6s var(--ease) both;
}
.maintenance-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-md);
  padding: 48px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.maintenance-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--psu-blue), var(--psu-blue-mid), var(--yellow-main));
}
.maintenance-icon-wrap {
  width: 100px;
  height: 100px;
  margin: 0 auto 28px;
  background: rgba(37, 99, 235, 0.08);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--psu-blue-mid);
}
.maintenance-icon-wrap.system {
  background: rgba(239, 68, 68, 0.08);
  color: var(--red-main);
}
.maintenance-icon-wrap.admin {
  background: rgba(139, 92, 246, 0.08);
  color: var(--purple-main);
}
.maintenance-icon-wrap svg {
  width: 54px;
  height: 54px;
  fill: currentColor;
  animation: slow-spin 12s linear infinite;
}
.maintenance-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 16px;
}
.maintenance-message {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.7;
  margin: 0;
}

/* Tab maintenance styling */
.tab-maintenance-placeholder {
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px dashed var(--border);
  border-radius: var(--r-xl);
  padding: 60px 40px;
  text-align: center;
  max-width: 600px;
  margin: 40px auto;
  box-shadow: var(--shadow-sm);
  animation: fadeSlideUp 0.4s var(--ease) both;
}
.tab-maintenance-placeholder .maintenance-icon-wrap {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
}
.tab-maintenance-placeholder .maintenance-icon-wrap svg {
  width: 42px;
  height: 42px;
}
.tab-maintenance-placeholder .maintenance-title {
  font-size: 18px;
  margin-bottom: 12px;
}
.tab-maintenance-placeholder .maintenance-message {
  font-size: 14px;
}

@keyframes slow-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Toggle Switch Style */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider-toggle-round {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 24px;
}
.slider-toggle-round:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.switch-toggle input:checked + .slider-toggle-round {
  background-color: #f97316;
}
.switch-toggle input:checked + .slider-toggle-round:before {
  transform: translateX(20px);
}

.admin-photo-change-workspace {
  grid-template-columns: minmax(560px, 1fr) minmax(430px, .82fr);
}

.admin-selected-user-card {
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: linear-gradient(145deg, #f8fbff, #f0fdf4);
  padding: 16px 18px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .05);
}

.admin-selected-user-title {
  margin-bottom: 12px;
  color: #0f172a;
  font-weight: 900;
}

.admin-selected-user-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  color: #475569;
  font-size: 14px;
  line-height: 1.45;
}

.admin-selected-user-grid > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.rl-existing-file {
  min-height: 124px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border: 1px dashed #bfdbfe;
  border-radius: 14px;
  background: #f8fafc;
  padding: 14px;
}

.admin-photo-change-old-photo {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid #dbeafe;
  box-shadow: 0 12px 24px rgba(15, 23, 42, .12);
}

#prev-admin-profile-photo .rl-prev-photo {
  width: auto;
  height: auto;
  max-width: 118px;
  max-height: 118px;
  object-fit: contain;
  background: #f8fafc;
}

.admin-photo-change-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.admin-photo-change-preview-head > div:first-child {
  min-width: 0;
}

.admin-photo-change-preview-head span {
  display: block;
  margin-bottom: 7px;
  color: #15803d;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-photo-change-preview-head h2 {
  margin: 0;
  color: #0f172a;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.admin-photo-change-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  color: #166534;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.admin-photo-change-live span {
  width: 7px;
  height: 7px;
  margin: 0;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .13);
  animation: personnelLivePulse 1.8s ease-in-out infinite;
}

.admin-photo-change-preview {
  width: min(440px, 100%);
  min-height: 260px;
  max-height: min(620px, 72vh);
  margin: 10px auto 18px;
  border-radius: 32px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: linear-gradient(145deg, #f8fafc, #eef7ff);
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.13);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
}

.admin-photo-change-preview img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(min(620px, 72vh) - 32px);
  object-fit: contain;
  border-radius: 20px;
  background: #f8fafc;
}

.admin-photo-change-note {
  display: grid;
  gap: 5px;
  max-width: 440px;
  margin: 0 auto;
  padding: 14px 16px;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  background: rgba(255, 255, 255, .72);
  color: #475569;
  font-size: 13px;
  line-height: 1.55;
}

.admin-photo-change-note strong {
  color: #0f172a;
  font-size: 14px;
}

@media (max-width: 1080px) {
  .admin-photo-change-workspace {
    grid-template-columns: minmax(460px, 1fr) minmax(340px, .78fr);
  }
}

@media (max-width: 820px) {
  .admin-photo-change-workspace {
    grid-template-columns: 1fr;
  }
  .admin-selected-user-grid {
    grid-template-columns: 1fr;
  }
  .admin-photo-change-preview {
    width: min(320px, 100%);
  }
  .admin-photo-change-preview-head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }
  .admin-photo-change-live {
    width: fit-content;
  }
}
