/* ====================================================
   RANGE ADMIN PORTAL - Portal-specific styles
   ==================================================== */

:root {
  --sidebar-width: 260px;
  --portal-header-height: 0px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: #F0F4F8;
  color: #1E293B;
  -webkit-font-smoothing: antialiased;
}

/* ============================
   LOGIN PAGE
============================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0A1F44 0%, #122554 50%, #1A3A6B 100%);
  position: relative;
  overflow: hidden;
  padding: 40px;
}
.login-page::before {
  content: '';
  position: absolute;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(30,111,217,0.12) 0%, transparent 70%);
  top: -200px; right: -200px;
  border-radius: 50%;
}

/* ============================
   STAFF ANIMATION SCENE
============================ */
.staff-scene {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 500px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

/* Background floating orbs */
.orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.orb-1 {
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(30,111,217,0.18) 0%, transparent 70%);
  top: 10%; left: 10%;
  animation: orb-float 8s ease-in-out infinite;
}
.orb-2 {
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(122,184,255,0.12) 0%, transparent 70%);
  top: 50%; right: 5%;
  animation: orb-float 11s ease-in-out infinite reverse;
}
.orb-3 {
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(58,142,255,0.1) 0%, transparent 70%);
  bottom: 20%; left: 30%;
  animation: orb-float 6s ease-in-out infinite 2s;
}
@keyframes orb-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-20px) scale(1.05); }
}

/* Staff portal label badge */
.staff-label {
  position: absolute;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 18px;
  background: rgba(122,184,255,0.1);
  border: 1px solid rgba(122,184,255,0.25);
  border-radius: 999px;
  color: #7AB8FF;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  animation: label-fade-in 1s ease both;
}
@keyframes label-fade-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Ground line */
.ground-line {
  position: absolute;
  bottom: 60px;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(122,184,255,0.3) 20%, rgba(122,184,255,0.3) 80%, transparent);
}

/* Walker figures container */
.walker {
  position: absolute;
  bottom: 62px;
  width: 80px;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.walker .figure {
  width: 80px;
  height: 160px;
  display: block;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.25));
}

/* Each figure's limbs swing */
.walker .leg-l { animation: leg-swing-l 0.7s ease-in-out infinite alternate; transform-origin: 25px 58px; }
.walker .leg-r { animation: leg-swing-r 0.7s ease-in-out infinite alternate; transform-origin: 35px 58px; }
.walker .arm-l { animation: arm-swing-l 0.7s ease-in-out infinite alternate; }
.walker .arm-r { animation: arm-swing-r 0.7s ease-in-out infinite alternate; }

@keyframes leg-swing-l {
  0%   { transform: rotate(-18deg); }
  100% { transform: rotate(18deg); }
}
@keyframes leg-swing-r {
  0%   { transform: rotate(18deg); }
  100% { transform: rotate(-18deg); }
}
@keyframes arm-swing-l {
  0%   { transform: rotate(12deg); }
  100% { transform: rotate(-12deg); }
}
@keyframes arm-swing-r {
  0%   { transform: rotate(-12deg); }
  100% { transform: rotate(12deg); }
}

/* Walker 1 – walks left-to-right, front */
.walker-1 {
  animation-name: walk-lr;
  animation-duration: 9s;
  animation-delay: 0s;
  z-index: 4;
}
/* Walker 2 – walks right-to-left, slightly behind */
.walker-2 {
  animation-name: walk-rl;
  animation-duration: 12s;
  animation-delay: -4s;
  z-index: 3;
  transform: scale(0.88);
}
.walker-2 .figure { transform: scaleX(-1); }
/* Walker 3 – smaller, far back, slow */
.walker-3 {
  animation-name: walk-lr;
  animation-duration: 16s;
  animation-delay: -7s;
  z-index: 2;
  transform: scale(0.72);
  bottom: 80px;
}
/* Walker 4 – right-to-left, medium */
.walker-4 {
  animation-name: walk-rl;
  animation-duration: 10s;
  animation-delay: -2s;
  z-index: 3;
  transform: scale(0.82);
}
.walker-4 .figure { transform: scaleX(-1); }

@keyframes walk-lr {
  0%   { left: -120px;  opacity: 0; }
  5%   { opacity: 1; }
  95%  { opacity: 1; }
  100% { left: calc(100% + 120px); opacity: 0; }
}
@keyframes walk-rl {
  0%   { right: -120px; left: auto; opacity: 0; transform: scale(var(--ws, 0.88)); }
  5%   { opacity: 1; }
  95%  { opacity: 1; }
  100% { right: calc(100% + 120px); left: auto; opacity: 0; }
}

/* Floating speech bubbles */
.bubble {
  position: absolute;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(122,184,255,0.2);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(122,184,255,0.8);
  white-space: nowrap;
  pointer-events: none;
}
.bubble-1 {
  top: 20%;  left: 12%;
  animation: bubble-float 5s ease-in-out infinite;
}
.bubble-2 {
  top: 38%;  right: 8%;
  animation: bubble-float 7s ease-in-out infinite 1.5s;
}
.bubble-3 {
  top: 60%;  left: 8%;
  animation: bubble-float 6s ease-in-out infinite 3s;
}
@keyframes bubble-float {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50%       { transform: translateY(-10px); opacity: 1; }
}

.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
  width: 100%;
  max-width: 1100px;
  z-index: 1;
  position: relative;
}

/* Centered-only layout (no animation panel) */
.login-wrapper--centered {
  gap: 0;
  max-width: 480px;
}

/* ============================
   LAMP LAYOUT
============================ */
.login-wrapper--lamp {
  gap: 56px;
  max-width: 820px;
  align-items: flex-end;
  padding-bottom: 48px;
}

/* ============================
   LAMP COMPONENT
============================ */
.login-lamp {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 180px;
  padding-top: 140px; /* space for cord above shade */
  cursor: default;
}

/* -- Cord -- */
.lamp-cord-wrap {
  position: absolute;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 3;
}
.lamp-cord-line {
  width: 1.5px;
  height: 110px;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.22));
}
.lamp-pull-bead {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #A8CEFF, #3A8EFF);
  border: 1.5px solid rgba(255,255,255,0.3);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(58,142,255,0.4);
  animation: bead-sway 4s ease-in-out infinite;
  transition: box-shadow 0.3s ease, transform 0.15s ease;
}
.lamp-pull-bead:hover {
  box-shadow: 0 0 14px rgba(58,142,255,0.8);
  transform: scale(1.2);
}
@keyframes bead-sway {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(3px); }
  75%       { transform: translateX(-3px); }
}

/* -- Shade (dome) -- */
.lamp-shade {
  width: 170px;
  height: 84px;
  border-radius: 85px 85px 0 0;
  background: linear-gradient(170deg, #0D2654 0%, #0A1F44 60%, #0F2A5A 100%);
  border: 1.5px solid rgba(122,184,255,0.12);
  border-bottom: none;
  position: relative;
  overflow: hidden;
  z-index: 2;
  transition: border-color 0.5s ease;
}
.lamp-on .lamp-shade {
  border-color: rgba(122,184,255,0.35);
  box-shadow: inset 0 -20px 40px rgba(30,111,217,0.15);
}

/* Inner glow inside shade */
.lamp-shade-glow {
  position: absolute;
  bottom: 0; left: 10%; right: 10%;
  height: 50px;
  background: radial-gradient(ellipse at 50% 100%, rgba(58,142,255,0) 0%, transparent 100%);
  transition: background 0.6s ease;
}
.lamp-on .lamp-shade-glow {
  background: radial-gradient(ellipse at 50% 100%, rgba(122,184,255,0.55) 0%, rgba(30,111,217,0.12) 70%, transparent 100%);
  animation: shade-pulse 3s ease-in-out infinite;
}
@keyframes shade-pulse {
  0%, 100% { opacity: 0.9; }
  50%       { opacity: 1; }
}

/* Emit ring at bottom of shade */
.lamp-emit-ring {
  position: absolute;
  bottom: -1px; left: 50%;
  transform: translateX(-50%);
  width: 148px;
  height: 5px;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  transition: all 0.5s ease;
}
.lamp-on .lamp-emit-ring {
  background: rgba(58,142,255,0.9);
  box-shadow:
    0 0 12px 3px rgba(58,142,255,0.7),
    0 0 28px 8px rgba(30,111,217,0.45),
    0 0 50px 14px rgba(10,31,68,0.2);
  animation: emit-flicker 0.1s ease 0s 3, emit-steady 2.5s ease-in-out 0.3s infinite;
}
@keyframes emit-flicker {
  0%   { opacity: 0; }
  40%  { opacity: 1; }
  60%  { opacity: 0.3; }
  100% { opacity: 1; }
}
@keyframes emit-steady {
  0%, 100% { opacity: 0.85; }
  50%       { opacity: 1; }
}

/* -- Light beam (cone downward) -- */
.lamp-beam {
  position: absolute;
  top: 218px; /* just below shade bottom */
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 110px solid transparent;
  border-right: 110px solid transparent;
  border-top: 260px solid rgba(30,111,217,0.07);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.7s ease 0.1s;
  z-index: 1;
}
.lamp-on .lamp-beam {
  opacity: 1;
  animation: beam-on 0.5s ease both;
}
@keyframes beam-on {
  from { opacity: 0; border-top-color: rgba(58,142,255,0.25); }
  to   { opacity: 1; border-top-color: rgba(30,111,217,0.07); }
}

/* -- Stem -- */
.lamp-stem {
  width: 7px;
  height: 130px;
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
  border-radius: 4px;
  z-index: 2;
}

/* -- Base neck + base -- */
.lamp-base-neck {
  width: 32px;
  height: 12px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  z-index: 2;
}
.lamp-base {
  width: 110px;
  height: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.09), rgba(255,255,255,0.05));
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  z-index: 2;
}

/* -- Floor glow pool -- */
.lamp-floor-pool {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(30,111,217,0), transparent 80%);
  pointer-events: none;
  transition: background 0.8s ease;
}
.lamp-on .lamp-floor-pool {
  background: radial-gradient(ellipse, rgba(30,111,217,0.22) 0%, rgba(58,142,255,0.06) 50%, transparent 80%);
}

/* ============================
   LAMP OFF / ON  —  Page States
============================ */

/* LOGIN PAGE dark overlay when lamp is off */
.login-page.lamp-off {
  background: linear-gradient(135deg, #050F22 0%, #08152E 50%, #0B1D3A 100%);
}
.login-page.lamp-on {
  background: linear-gradient(135deg, #0A1F44 0%, #122554 50%, #1A3A6B 100%);
}

/* Card visibility */
.login-page .login-card {
  transition: opacity 0.9s ease, filter 0.9s ease, transform 0.9s ease;
}
.login-page.lamp-off .login-card {
  opacity: 0.06;
  filter: brightness(0.2) blur(1px);
  transform: translateY(4px);
}
.login-page.lamp-on .login-card {
  opacity: 1;
  filter: brightness(1) blur(0);
  transform: translateY(0);
}

/* Responsive: hide lamp on small screens */
@media (max-width: 860px) {
  .login-wrapper--lamp {
    flex-direction: column;
    align-items: center;
    padding-bottom: 0;
    gap: 0;
    max-width: 480px;
  }
  .login-lamp {
    display: none;
  }
  .login-page.lamp-off .login-card {
    opacity: 1;
    filter: none;
    transform: none;
  }
}

.login-animation {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 500px;
  max-width: 600px;
  width: 100%;
}

@media (max-width: 900px) {
  .login-wrapper {
    flex-direction: column;
    gap: 0;
  }
  .login-animation {
    display: none;
  }
}

.login-card {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 56px 48px;
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}
.login-logo img { height: 220px; margin: 0 auto 24px; display: block; }
.login-logo h1 {
  font-family: 'Outfit', sans-serif;
  color: white;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.login-logo p {
  color: rgba(255,255,255,0.45);
  font-size: 0.82rem;
}

.portal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(30,111,217,0.2);
  border: 1px solid rgba(30,111,217,0.35);
  border-radius: 999px;
  color: #7AB8FF;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.portal-badge::before {
  content: '';
  width: 6px; height: 6px;
  background: #3A8EFF;
  border-radius: 50%;
}

/* Form */
.form-group {
  margin-bottom: 20px;
}
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.form-label.dark { color: #475569; }

.form-input {
  width: 100%;
  padding: 13px 16px;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  transition: all 0.2s ease;
  outline: none;
}
.form-input:focus {
  border-color: rgba(58,142,255,0.6);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 3px rgba(30,111,217,0.12);
}
.form-input::placeholder { color: rgba(255,255,255,0.25); }

.form-input.light {
  background: white;
  border-color: #E2E8F0;
  color: #1E293B;
}
.form-input.light:focus {
  border-color: #1E6FD9;
  box-shadow: 0 0 0 3px rgba(30,111,217,0.1);
}
.form-input.light::placeholder { color: #94A3B8; }

.form-select {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  background: white;
  color: #1E293B;
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
}
.form-select:focus { border-color: #1E6FD9; box-shadow: 0 0 0 3px rgba(30,111,217,0.1); }

.form-textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  background: white;
  color: #1E293B;
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  resize: vertical;
  min-height: 110px;
  outline: none;
  transition: border-color 0.2s;
}
.form-textarea:focus { border-color: #1E6FD9; box-shadow: 0 0 0 3px rgba(30,111,217,0.1); }

.btn-portal {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-portal-primary {
  background: linear-gradient(135deg, #1E6FD9, #0A1F44);
  color: white;
  box-shadow: 0 4px 16px rgba(30,111,217,0.3);
}
.btn-portal-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(30,111,217,0.4); }
.btn-portal-primary:active { transform: none; }
.btn-portal-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-portal-sm {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.btn-edit { background: rgba(30,111,217,0.1); color: #1E6FD9; }
.btn-edit:hover { background: rgba(30,111,217,0.18); }
.btn-delete { background: rgba(220,38,38,0.08); color: #DC2626; }
.btn-delete:hover { background: rgba(220,38,38,0.15); }
.btn-success { background: rgba(16,185,129,0.1); color: #059669; }
.btn-success:hover { background: rgba(16,185,129,0.18); }

.login-error {
  background: rgba(220,38,38,0.12);
  border: 1px solid rgba(220,38,38,0.25);
  border-radius: 10px;
  padding: 12px 16px;
  color: #FCA5A5;
  font-size: 0.85rem;
  margin-bottom: 20px;
  display: none;
}
.login-error.show { display: block; }

.login-back {
  display: block;
  text-align: center;
  margin-top: 24px;
  color: rgba(255,255,255,0.4);
  font-size: 0.82rem;
  text-decoration: none;
  transition: color 0.2s;
}
.login-back:hover { color: rgba(255,255,255,0.75); }

.form-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.form-label-row .form-label { margin-bottom: 0; }
.forgot-link {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color 0.18s;
  font-weight: 500;
}
.forgot-link:hover { color: #7AB8FF; }

/* Modal */
.portal-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.portal-modal.show { opacity: 1; visibility: visible; }
.modal-content {
  background: white;
  border-radius: 20px;
  width: 90%;
  max-width: 400px;
  padding: 32px;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.portal-modal.show .modal-content { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-header h2 { font-size: 1.25rem; font-weight: 700; color: #0A1F44; font-family: 'Outfit', sans-serif; }
.close-modal { background: none; border: none; font-size: 1.5rem; color: #64748B; cursor: pointer; padding: 4px; line-height: 1; }
.close-modal:hover { color: #0A1F44; }
.modal-body p { font-size: 0.9rem; color: #64748B; margin-bottom: 24px; line-height: 1.5; }
.modal-footer { display: flex; gap: 12px; margin-top: 24px; }
.btn-portal-secondary { background: #F1F5F9; color: #475569; }
.btn-portal-secondary:hover { background: #E2E8F0; }

/* ============================
   2FA STEP DOTS
============================ */
.tfa-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transition: background 0.3s, box-shadow 0.3s;
}
.tfa-dot--done {
  background: #1E6FD9;
}
.tfa-dot--active {
  background: #3A8EFF;
  box-shadow: 0 0 0 3px rgba(58,142,255,0.25);
  animation: dot-pulse 1.8s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(58,142,255,0.25); }
  50%       { box-shadow: 0 0 0 5px rgba(58,142,255,0.1); }
}


/* ============================
   2FA DIGIT BOXES
============================ */
.tfa-digit {
  width: 50px;
  height: 58px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  font-family: 'Inter', monospace;
  color: white;
  background: rgba(255,255,255,0.07);
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  caret-color: transparent;
}
.tfa-digit:focus {
  border-color: #3A8EFF;
  background: rgba(58,142,255,0.12);
  box-shadow: 0 0 0 3px rgba(30,111,217,0.2);
}
.tfa-digit.tfa-error {
  border-color: rgba(239,68,68,0.7);
  background: rgba(220,38,38,0.1);
  animation: tfa-shake 0.35s ease;
}
@keyframes tfa-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-4px); }
  60%       { transform: translateX(4px); }
}
@media (max-width: 480px) {
  .tfa-digit { width: 40px; height: 50px; font-size: 1.2rem; border-radius: 10px; }
  #tfa-boxes { gap: 6px; }
}


/* Modal Input Specificity Fixes */
.portal-modal .form-input {
  background: white !important;
  border-color: #E2E8F0 !important;
  color: #1E293B !important;
}
.portal-modal .form-input:focus {
  background: white !important;
  border-color: #1E6FD9 !important;
  box-shadow: 0 0 0 3px rgba(30,111,217,0.1) !important;
}
.portal-modal .form-input::placeholder {
  color: #94A3B8 !important;
}

/* ============================
   DASHBOARD LAYOUT
============================ */
.portal-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.portal-sidebar {
  width: var(--sidebar-width);
  background: #0A1F44;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--portal-header-height); 
  left: 0;
  height: calc(100vh - var(--portal-header-height));
  z-index: 200;
  overflow-y: auto;
  transition: top 0.3s;
}

.sidebar-header {
  padding: 28px 24px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.sidebar-logo img { height: 140px; display: block; }
.sidebar-portal-tag {
  display: inline-block;
  margin-top: 12px;
  padding: 3px 10px;
  background: rgba(30,111,217,0.18);
  border: 1px solid rgba(30,111,217,0.3);
  border-radius: 999px;
  color: #7AB8FF;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sidebar-nav { flex: 1; padding: 24px 16px; }
.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  padding: 0 8px;
  margin-bottom: 10px;
  margin-top: 24px;
}
.sidebar-section-label:first-child { margin-top: 0; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  color: rgba(255,255,255,0.55);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  margin-bottom: 2px;
}
.sidebar-link:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.9); }
.sidebar-link.active { background: rgba(30,111,217,0.18); color: #7AB8FF; }
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
  padding: 20px 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 10px;
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #1E6FD9, #0A1F44);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 0.85rem;
  flex-shrink: 0;
}
.user-name { font-size: 0.82rem; font-weight: 600; color: rgba(255,255,255,0.8); }
.user-email { font-size: 0.72rem; color: rgba(255,255,255,0.35); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px;}

/* Main Content */
.portal-main {
  margin-left: var(--sidebar-width);
  margin-top: var(--portal-header-height);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.portal-topbar {
  background: white;
  border-bottom: 1px solid #E2E8F0;
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: var(--portal-header-height);
  z-index: 100;
}
.topbar-title { font-size: 1.1rem; font-weight: 700; color: #0A1F44; font-family: 'Outfit', sans-serif; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }

.portal-content { padding: 32px; flex: 1; }

/* Stat Cards */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 32px; }
.stat-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid #E2E8F0;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.stat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: rgba(30,111,217,0.08);
  display: flex; align-items: center; justify-content: center;
  color: #1E6FD9;
  flex-shrink: 0;
}
.stat-num { font-size: 1.8rem; font-weight: 800; color: #0A1F44; font-family: 'Outfit', sans-serif; line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 0.8rem; color: #94A3B8; font-weight: 500; }

/* Panel */
.panel {
  background: white;
  border-radius: 18px;
  border: 1px solid #E2E8F0;
  overflow: hidden;
  margin-bottom: 28px;
}
.panel-header {
  padding: 20px 28px;
  border-bottom: 1px solid #F1F5F9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-title { font-size: 0.95rem; font-weight: 700; color: #0A1F44; font-family: 'Outfit', sans-serif; }
.panel-body { padding: 28px; }

/* Create Form */
.create-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.create-form-grid .span-2 { grid-column: 1 / -1; }

/* Services Table */
.services-table { width: 100%; border-collapse: collapse; }
.services-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #94A3B8;
  padding: 12px 16px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
}
.services-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #F1F5F9;
  font-size: 0.88rem;
  color: #334155;
  vertical-align: middle;
}
.services-table tr:last-child td { border-bottom: none; }
.services-table tr:hover td { background: #F8FAFC; }
.table-img {
  width: 48px; height: 36px; object-fit: cover;
  border-radius: 8px; display: block;
}
.table-actions { display: flex; gap: 8px; }
.cat-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

/* Toast */
.toast-container { position: fixed; bottom: 28px; right: 28px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: white;
  border-radius: 14px;
  padding: 14px 20px;
  box-shadow: 0 8px 32px rgba(10,31,68,0.18);
  border: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #0A1F44;
  animation: toast-in 0.3s var(--ease-smooth, cubic-bezier(0.16, 1, 0.3, 1));
  min-width: 280px;
}
.toast.success svg { color: #10B981; }
.toast.error svg { color: #EF4444; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
  opacity: 0; visibility: hidden;
  transition: all 0.22s ease;
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal {
  background: white;
  border-radius: 20px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 36px;
  transform: translateY(16px) scale(0.98);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.show .modal { transform: none; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.modal-title { font-size: 1.1rem; font-weight: 700; color: #0A1F44; font-family: 'Outfit', sans-serif; }
.modal-close { cursor: pointer; color: #94A3B8; transition: color 0.18s; background: none; border: none; }
.modal-close:hover { color: #0A1F44; }

/* Responsive */
@media (max-width: 1100px) { .stat-cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 768px) {
  .portal-layout { flex-direction: column; margin-top: 0; }
  .portal-sidebar { position: relative; width: 100%; height: auto; top: 0; }
  .portal-main { margin-left: 0; margin-top: 0; }
  .portal-topbar { top: 0; }
  .create-form-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   VOLUME LIGHT SWEEP  —  Login Page Animation (right → left)
   No button. Auto-plays on page load.
   ============================================================ */

/* Login page: reset padding from pendant, keep flex-column for stacking */
.login-page {
  flex-direction: column;
  padding-top: 0;
  /* Start very dark — overlay lifts as animation plays */
  background: linear-gradient(135deg, #040C1C 0%, #060E22 50%, #08122A 100%);
  animation: page-brighten 2.4s ease 0.4s both;
}
@keyframes page-brighten {
  to { background: linear-gradient(135deg, #0A1F44 0%, #122554 50%, #1A3A6B 100%); }
}

/* ── Volume light container ── */
.volume-light {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

/* ── Main beam: large radial glow that slides RIGHT → LEFT ── */
.vol-beam {
  position: absolute;
  top: 50%;
  right: 0;
  width: 75vw;
  height: 180%;
  transform: translateY(-50%);
  background: radial-gradient(
    ellipse 65% 75% at 95% 50%,
    rgba(122, 184, 255, 0.22)  0%,
    rgba(58,  142, 255, 0.11)  32%,
    rgba(30,  111, 217, 0.05)  58%,
    transparent                80%
  );
  /* Start off-screen right, slide to resting position */
  animation: beam-slide 2.2s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}
@keyframes beam-slide {
  0%   { right: -90vw; opacity: 0; }
  12%  { opacity: 1; }
  100% { right: 0;    opacity: 1; }
}

/* ── Light ray streaks (diagonal lines in the beam) ── */
.vol-streak {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  transform-origin: right center;
  opacity: 0;
  animation: streak-fade 2.4s ease 0.6s both;
}
@keyframes streak-fade {
  0%   { opacity: 0; transform: translateX(60px); }
  100% { opacity: 1; transform: translateX(0); }
}
.vol-streak-1 {
  width: 45vw;
  background: linear-gradient(
    -12deg,
    transparent 0%, transparent 30%,
    rgba(122,184,255,0.04) 45%,
    transparent 60%, transparent 100%
  );
  animation-delay: 0.5s;
}
.vol-streak-2 {
  width: 55vw;
  background: linear-gradient(
    -8deg,
    transparent 0%, transparent 40%,
    rgba(122,184,255,0.06) 55%,
    transparent 70%, transparent 100%
  );
  animation-delay: 0.65s;
}
.vol-streak-3 {
  width: 38vw;
  background: linear-gradient(
    -18deg,
    transparent 0%, transparent 55%,
    rgba(122,184,255,0.03) 65%,
    transparent 75%, transparent 100%
  );
  animation-delay: 0.8s;
}

/* ── Glow source: bright hot-spot on the far right edge ── */
.vol-glow-source {
  position: absolute;
  top: 50%;
  right: -8vw;
  width: 30vw;
  height: 100%;
  transform: translateY(-50%);
  background: radial-gradient(
    ellipse 55% 60% at 100% 50%,
    rgba(200, 228, 255, 0.18) 0%,
    rgba(122, 184, 255, 0.10) 30%,
    transparent 65%
  );
  animation: source-appear 1.8s ease 0.3s both;
}
@keyframes source-appear {
  0%   { opacity: 0; right: -30vw; }
  100% { opacity: 1; right: -8vw; }
}

/* ── Login card auto-reveal ── */
.login-card {
  position: relative;
  z-index: 5;
  /* Override any previous transition with animation */
  transition: none;
  animation: card-reveal 1.1s cubic-bezier(0.16, 1, 0.3, 1) 1.0s both;
}
@keyframes card-reveal {
  0% {
    opacity: 0;
    filter: brightness(0.1) blur(3px);
    transform: translateY(10px) scale(0.99);
  }
  100% {
    opacity: 1;
    filter: brightness(1) blur(0px);
    transform: translateY(0) scale(1);
  }
}

/* ── Subtle continuous light pulse after reveal ── */
.volume-light::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 0;
  width: 50vw;
  height: 120%;
  transform: translateY(-50%);
  background: radial-gradient(
    ellipse 60% 70% at 90% 50%,
    rgba(58,142,255,0.04) 0%,
    transparent 70%
  );
  opacity: 0;
  animation: ambient-pulse 4s ease-in-out 2.4s infinite;
}
@keyframes ambient-pulse {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}



/* Pendant container — hangs from top center */
.pendant {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 20;
  pointer-events: none;
}

/* Cord from ceiling */
.pendant-cord {
  width: 2px;
  height: 130px;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.06) 0%,
    rgba(255,255,255,0.25) 100%);
}

/* Clickable bulb button */
.pendant-bulb {
  pointer-events: all;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  outline: none;
  padding: 0;
  position: relative;
}
.pendant-bulb:focus-visible {
  outline: 2px solid rgba(122,184,255,0.5);
  border-radius: 50%;
}

/* Outer glow halo (only visible when ON) */
.bulb-halo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(122,184,255,0) 0%, transparent 70%);
  pointer-events: none;
  transition: background 0.6s ease, box-shadow 0.6s ease;
}

/* Glass globe */
.bulb-glass {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%,
    rgba(160,200,255,0.06) 0%,
    rgba(30,60,120,0.04) 60%,
    rgba(10,31,68,0.06) 100%);
  border: 1.5px solid rgba(122,184,255,0.15);
  position: relative;
  transition: background 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
  overflow: hidden;
}

/* Filament inside glass */
.bulb-filament {
  display: block;
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 20px;
  border: 1.5px solid rgba(122,184,255,0.12);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  transition: border-color 0.5s ease, box-shadow 0.5s ease;
}

/* Metal screw cap at bottom of bulb */
.bulb-cap {
  display: block;
  width: 28px;
  height: 14px;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.12) 0%,
    rgba(255,255,255,0.06) 100%);
  border-radius: 0 0 6px 6px;
  border: 1px solid rgba(255,255,255,0.08);
  border-top: none;
  transition: background 0.4s ease;
}

/* Light cone beam beneath the bulb */
.pendant-beam {
  position: absolute;
  top: 196px; /* cord 130 + glass 52 + cap 14 = 196 */
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 280px solid transparent;
  border-right: 280px solid transparent;
  border-top: 480px solid rgba(30,111,217,0.055);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease 0.1s;
}

/* ── LAMP OFF state ── */
.login-page.lamp-off {
  background: linear-gradient(135deg, #040C1C 0%, #060E22 50%, #08122A 100%);
}
.login-page.lamp-off .login-card {
  opacity: 0.04;
  filter: brightness(0.15) blur(1px);
  transform: translateY(6px);
}

/* ── LAMP ON state ── */
.login-page.lamp-on {
  background: linear-gradient(135deg, #0A1F44 0%, #122554 50%, #1A3A6B 100%);
}
.login-page.lamp-on .login-card {
  opacity: 1;
  filter: brightness(1) blur(0);
  transform: translateY(0);
}

/* Card transition always smooth */
.login-card {
  transition: opacity 0.9s ease, filter 0.9s ease, transform 0.9s ease;
}

/* Pendant beam shows on */
.login-page.lamp-on .pendant-beam {
  opacity: 1;
  animation: beam-ignite 0.6s ease both;
}
@keyframes beam-ignite {
  0%   { opacity: 0; border-top-color: rgba(58,142,255,0.3); }
  40%  { opacity: 0.7; border-top-color: rgba(58,142,255,0.15); }
  100% { opacity: 1; border-top-color: rgba(30,111,217,0.055); }
}

/* Bulb glow when ON */
.login-page.lamp-on .bulb-glass {
  background: radial-gradient(circle at 38% 32%,
    #ffffff 0%,
    #C5DEFF 35%,
    #3A8EFF 75%,
    #1E6FD9 100%);
  border-color: rgba(255,255,255,0.5);
  box-shadow:
    0 0 16px 6px rgba(122,184,255,0.75),
    0 0 40px 14px rgba(58,142,255,0.45),
    0 0 80px 28px rgba(30,111,217,0.22),
    inset 0 0 12px rgba(255,255,255,0.2);
  animation: bulb-flicker 0.12s ease 0s 4, bulb-breathe 3s ease-in-out 0.48s infinite;
}
@keyframes bulb-flicker {
  0%   { opacity: 0.2; }
  50%  { opacity: 1; }
  70%  { opacity: 0.5; }
  100% { opacity: 1; }
}
@keyframes bulb-breathe {
  0%, 100% { box-shadow: 0 0 16px 6px rgba(122,184,255,0.75), 0 0 40px 14px rgba(58,142,255,0.45), 0 0 80px 28px rgba(30,111,217,0.22); }
  50%       { box-shadow: 0 0 22px 9px rgba(122,184,255,0.85), 0 0 55px 20px rgba(58,142,255,0.55), 0 0 100px 36px rgba(30,111,217,0.28); }
}

/* Filament glow */
.login-page.lamp-on .bulb-filament {
  border-color: rgba(255,255,255,0.8);
  box-shadow: 0 0 8px 2px rgba(200,225,255,0.6);
}

/* Halo ring when ON */
.login-page.lamp-on .bulb-halo {
  background: radial-gradient(circle,
    rgba(122,184,255,0.18) 0%,
    rgba(58,142,255,0.06) 50%,
    transparent 70%);
  box-shadow: 0 0 50px 20px rgba(30,111,217,0.12);
}

/* Cap brightens */
.login-page.lamp-on .bulb-cap {
  background: linear-gradient(180deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0.1) 100%);
}

/* Subtle hover on bulb */
.pendant-bulb:hover .bulb-glass {
  border-color: rgba(122,184,255,0.4);
  box-shadow: 0 0 10px 3px rgba(58,142,255,0.25);
}

/* Responsive: full width centered on small screens */
@media (max-width: 600px) {
  .login-page {
    padding-top: 200px;
  }
  .pendant-beam {
    border-left-width: 180px;
    border-right-width: 180px;
  }
}
