/* ==========================================================================
   MODULE-SPECIFIC STYLES (GRIDS, CHECK-IN WIDGET, STEP WIZARD, CALENDAR)
   ========================================================================== */

/* Grid Utility Systems */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-7-5 { display: grid; grid-template-columns: 7fr 5fr; gap: 16px; }
.grid-8-4 { display: grid; grid-template-columns: 8fr 4fr; gap: 16px; }

@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-7-5, .grid-8-4 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.mb-6 { margin-bottom: 16px; }
.mb-8 { margin-bottom: 22px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-3 { gap: 10px; }

/* ==========================================================================
   ATTENDANCE & FACE CHECK-IN SIMULATOR
   ========================================================================== */
.checkin-hero-card {
  background: linear-gradient(135deg, #2B3674 0%, #111C44 100%);
  color: #FFFFFF;
  border-radius: 18px;
  padding: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 32px rgba(43, 54, 116, 0.3);
}

.checkin-hero-card::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(67, 24, 255, 0.4) 0%, rgba(117, 81, 255, 0) 70%);
  pointer-events: none;
}

.camera-preview-box {
  position: relative;
  width: 100%;
  height: 190px;
  border-radius: 14px;
  background: #0B1437;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(255, 255, 255, 0.2);
}

.camera-face-oval {
  width: 130px;
  height: 170px;
  border-radius: 50%;
  border: 2px solid var(--color-success);
  box-shadow: 0 0 20px rgba(5, 205, 153, 0.4);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-border 2s infinite ease-in-out;
}

@keyframes pulse-border {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.04); opacity: 1; box-shadow: 0 0 30px rgba(5, 205, 153, 0.7); }
}

.gps-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  font-size: 0.78rem;
  font-weight: 600;
}

.pulsing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-success);
  box-shadow: 0 0 0 0 rgba(5, 205, 153, 0.7);
  animation: pulse-green 1.5s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes pulse-green {
  to { box-shadow: 0 0 0 10px rgba(5, 205, 153, 0); }
}

/* ==========================================================================
   STEP WIZARD (CREATE EMPLOYEE)
   ========================================================================== */
.wizard-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin-bottom: 36px;
}

.wizard-steps::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 20px;
  right: 20px;
  height: 3px;
  background-color: var(--border-subtle);
  z-index: 1;
}

.wizard-step-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.step-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--bg-card);
  border: 2px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.wizard-step-item.active .step-circle {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #FFFFFF;
  box-shadow: 0 6px 16px rgba(67, 24, 255, 0.35);
}

.wizard-step-item.completed .step-circle {
  background-color: var(--color-success);
  border-color: var(--color-success);
  color: #FFFFFF;
}

.step-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-top: 8px;
  text-align: center;
}

.wizard-step-item.active .step-title {
  color: var(--brand-primary);
}

/* ==========================================================================
   MONTHLY CALENDAR GRID (SHIFT MANAGEMENT)
   ========================================================================== */
.calendar-header-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  padding-top: 12px;
}

.cal-day-cell {
  background-color: var(--bg-app);
  border-radius: var(--radius-card-sm);
  padding: 10px 8px;
  min-height: 85px;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.cal-day-cell:hover {
  background-color: var(--bg-hover);
  border-color: var(--border-light);
}

.cal-day-cell.today {
  background-color: var(--brand-light);
  border-color: var(--brand-primary);
}

.cal-day-number {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.cal-shift-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shift-morning   { background: rgba(57, 101, 255, 0.15); color: #3965FF; }
.shift-afternoon { background: rgba(255, 181, 71, 0.18); color: #D97706; }
.shift-night     { background: rgba(139, 92, 246, 0.15); color: #8B5CF6; }
.shift-wfh       { background: rgba(5, 205, 153, 0.15);  color: #05CD99; }
.shift-off       { background: rgba(112, 126, 174, 0.15); color: #707EAE; }

/* ==========================================================================
   WORKFLOW MATRIX VISUAL FLOW
   ========================================================================== */
.workflow-step-node {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  font-weight: 700;
}

.workflow-arrow {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* ==========================================================================
   INTERACTIVE PROFILE & PERSONAL DATA STYLES
   ========================================================================== */
.profile-cover-mesh {
  height: 140px;
  background: linear-gradient(135deg, #1E40AF 0%, #3B82F6 40%, #06B6D4 100%);
  position: relative;
  overflow: hidden;
}

.profile-cover-mesh::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.profile-avatar-pulse {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  border: 4px solid var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 1.8rem;
  font-weight: 800;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.profile-avatar-pulse:hover {
  transform: scale(1.05);
}

.online-pulse-ring {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--color-success);
  border: 2.5px solid var(--bg-card);
  box-shadow: 0 0 0 0 rgba(5, 205, 153, 0.7);
  animation: pulse-green 1.8s infinite;
}

.digital-badge-card {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  color: #FFFFFF;
  border-radius: 16px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.digital-badge-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transform: skewX(-20deg);
  animation: shimmer 6s infinite ease-in-out;
}

@keyframes shimmer {
  0% { left: -100%; }
  20%, 100% { left: 200%; }
}

.info-item-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
}

.info-item-box:hover {
  background: var(--bg-hover);
  border-color: var(--brand-primary);
  transform: translateY(-1px);
}

.copy-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-pill-btn:hover {
  background: var(--brand-primary);
  color: #FFFFFF;
  border-color: var(--brand-primary);
}

.timeline-track-item {
  position: relative;
  padding-left: 28px;
  padding-bottom: 20px;
}

.timeline-track-item:last-child {
  padding-bottom: 0;
}

.timeline-track-item::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 14px;
  bottom: 0;
  width: 2px;
  background: var(--border-subtle);
}

.timeline-track-item:last-child::before {
  display: none;
}

.timeline-dot {
  position: absolute;
  left: 0;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brand-primary);
  border: 3px solid var(--bg-card);
  box-shadow: 0 0 0 2px var(--brand-primary);
}

.timeline-dot.completed {
  background: var(--color-success);
  box-shadow: 0 0 0 2px var(--color-success);
}

/* ==========================================================================
   GLOBAL SMOOTH ENTRANCE ANIMATIONS
   Automatically applied to all page content on route change.
   Uses CSS counter + custom property for staggered delays.
   ========================================================================== */

/* ── Keyframes ── */
@keyframes agy-fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes agy-fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes agy-slideInRight {
  0% {
    opacity: 0;
    transform: translateX(14px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes agy-scaleIn {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ── Reusable Animation Utility Classes ── */
.animate-in {
  animation: agy-fadeInUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.animate-fade {
  animation: agy-fadeIn 0.35s ease both;
}

.animate-slide-right {
  animation: agy-slideInRight 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.animate-scale {
  animation: agy-scaleIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── Auto-stagger Direct Children of Content Body ──
   Every direct child of the page container gets a
   progressive delay for a cascading entrance effect.
*/
.content-body > * {
  animation: agy-fadeIn 0.3s ease both;
}

.content-body .hz-card,
.content-body .grid-4 > *,
.content-body .grid-3 > *,
.content-body .grid-2 > *,
.content-body .grid-7-5 > *,
.content-body .grid-8-4 > * {
  animation: agy-fadeInUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Stagger delays — each successive card enters slightly later */
.content-body .grid-4 > *:nth-child(1),
.content-body .grid-3 > *:nth-child(1),
.content-body .grid-2 > *:nth-child(1),
.content-body .grid-7-5 > *:nth-child(1),
.content-body .grid-8-4 > *:nth-child(1) { animation-delay: 0.04s; }

.content-body .grid-4 > *:nth-child(2),
.content-body .grid-3 > *:nth-child(2),
.content-body .grid-2 > *:nth-child(2),
.content-body .grid-7-5 > *:nth-child(2),
.content-body .grid-8-4 > *:nth-child(2) { animation-delay: 0.10s; }

.content-body .grid-4 > *:nth-child(3),
.content-body .grid-3 > *:nth-child(3),
.content-body .grid-2 > *:nth-child(3) { animation-delay: 0.16s; }

.content-body .grid-4 > *:nth-child(4),
.content-body .grid-3 > *:nth-child(4),
.content-body .grid-2 > *:nth-child(4) { animation-delay: 0.22s; }

.content-body .grid-4 > *:nth-child(5) { animation-delay: 0.28s; }
.content-body .grid-4 > *:nth-child(6) { animation-delay: 0.34s; }
.content-body .grid-4 > *:nth-child(7) { animation-delay: 0.40s; }
.content-body .grid-4 > *:nth-child(8) { animation-delay: 0.46s; }

/* Standalone cards stagger by DOM order */
.content-body > .hz-card:nth-child(1),
.content-body > div:nth-child(1) { animation-delay: 0.02s; }
.content-body > .hz-card:nth-child(2),
.content-body > div:nth-child(2) { animation-delay: 0.08s; }
.content-body > .hz-card:nth-child(3),
.content-body > div:nth-child(3) { animation-delay: 0.14s; }
.content-body > .hz-card:nth-child(4),
.content-body > div:nth-child(4) { animation-delay: 0.20s; }
.content-body > .hz-card:nth-child(5),
.content-body > div:nth-child(5) { animation-delay: 0.26s; }

/* ── Table Rows (slide in from right) ── */
.content-body .hz-table tbody tr {
  animation: agy-slideInRight 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.content-body .hz-table tbody tr:nth-child(1) { animation-delay: 0.04s; }
.content-body .hz-table tbody tr:nth-child(2) { animation-delay: 0.08s; }
.content-body .hz-table tbody tr:nth-child(3) { animation-delay: 0.10s; }
.content-body .hz-table tbody tr:nth-child(4) { animation-delay: 0.13s; }
.content-body .hz-table tbody tr:nth-child(5) { animation-delay: 0.16s; }
.content-body .hz-table tbody tr:nth-child(6) { animation-delay: 0.19s; }
.content-body .hz-table tbody tr:nth-child(7) { animation-delay: 0.22s; }
.content-body .hz-table tbody tr:nth-child(8) { animation-delay: 0.25s; }
.content-body .hz-table tbody tr:nth-child(n+9) { animation-delay: 0.28s; }

/* ── Info Boxes & List Rows (scale-in) ── */
.content-body .info-item-box {
  animation: agy-scaleIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── Badges animate-in ── */
.content-body .badge {
  animation: agy-fadeIn 0.5s ease both;
  animation-delay: 0.15s;
}

/* ── Profile Page Specific ── */
.content-body .profile-tab-item {
  animation: agy-fadeInUp 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── KPI / Stat Metric Cards (top row) ── */
.content-body .kpi-card,
.content-body [class*="stat"] {
  animation: agy-scaleIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── Chart areas (fade in slightly later) ── */
.content-body [id*="chart-"],
.content-body svg {
  animation: agy-fadeIn 0.5s ease both;
  animation-delay: 0.2s;
}

/* ── Modal overlay entrance ── */
.modal-backdrop.active .modal-content {
  animation: agy-scaleIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ==========================================================================
   SMOOTH CHART ANIMATIONS & INTERACTION SYSTEM
   ========================================================================== */

/* 1. Keyframes for Vertical Bar Chart Growing from Bottom */
@keyframes chartBarGrowUp {
  0% {
    transform: scaleY(0);
    opacity: 0.2;
  }
  100% {
    transform: scaleY(1);
    opacity: 1;
  }
}

/* 2. Keyframes for SVG Donut Sweep & Scale */
@keyframes donutChartSpin {
  0% {
    stroke-dashoffset: 100;
    transform: rotate(-90deg) scale(0.92);
    opacity: 0;
  }
  100% {
    transform: rotate(-90deg) scale(1);
    opacity: 1;
  }
}

/* 3. Keyframes for Horizontal Progress Bars */
@keyframes progressFillRight {
  0% {
    transform: scaleX(0);
    opacity: 0;
  }
  100% {
    transform: scaleX(1);
    opacity: 1;
  }
}

/* 4. Pulse & Glow keyframe for chart hover highlights */
@keyframes chartBarGlow {
  0%, 100% { filter: drop-shadow(0 0 0px transparent); }
  50% { filter: drop-shadow(0 4px 12px rgba(67, 24, 255, 0.35)); }
}

/* ── Vertical Bar Charts Styling & Animation ── */
.content-body [style*="height:"],
.content-body [style*="height :"] {
  /* Targeted container for vertical bars */
}

/* Auto-target bar elements with border-radius at top */
.content-body [style*="border-radius: 8px 8px 0 0"],
.content-body [style*="border-radius: 7px 7px"],
.content-body [style*="border-radius: 6px 6px"],
.chart-bar-item {
  transform-origin: bottom center;
  animation: chartBarGrowUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.22s ease;
  cursor: pointer;
}

/* Staggered delay for vertical bars (up to 12 bars) */
div > div:nth-child(1) > [style*="border-radius:"],
div > div:nth-child(1) > .chart-bar-item { animation-delay: 0.05s; }
div > div:nth-child(2) > [style*="border-radius:"],
div > div:nth-child(2) > .chart-bar-item { animation-delay: 0.10s; }
div > div:nth-child(3) > [style*="border-radius:"],
div > div:nth-child(3) > .chart-bar-item { animation-delay: 0.15s; }
div > div:nth-child(4) > [style*="border-radius:"],
div > div:nth-child(4) > .chart-bar-item { animation-delay: 0.20s; }
div > div:nth-child(5) > [style*="border-radius:"],
div > div:nth-child(5) > .chart-bar-item { animation-delay: 0.25s; }
div > div:nth-child(6) > [style*="border-radius:"],
div > div:nth-child(6) > .chart-bar-item { animation-delay: 0.30s; }
div > div:nth-child(7) > [style*="border-radius:"],
div > div:nth-child(7) > .chart-bar-item { animation-delay: 0.35s; }
div > div:nth-child(8) > [style*="border-radius:"],
div > div:nth-child(8) > .chart-bar-item { animation-delay: 0.40s; }

/* Interactive Hover Lift & Glow for Vertical Bars */
.content-body [style*="border-radius: 8px 8px 0 0"]:hover,
.content-body [style*="border-radius: 7px 7px"]:hover,
.content-body [style*="border-radius: 6px 6px"]:hover,
.chart-bar-item:hover {
  transform: scaleY(1.05) scaleX(1.06);
  filter: brightness(1.15) drop-shadow(0 6px 14px rgba(67, 24, 255, 0.4));
  opacity: 1 !important;
}

/* ── SVG Donut Chart Animation & Segmented Ring Style ── */
.donut-ring-svg {
  transform: rotate(-90deg);
  transform-origin: center;
}

.donut-ring-svg .donut-arc {
  transform-origin: 50px 50px;
  transition: stroke-width 0.25s ease,
              filter 0.25s ease;
  cursor: pointer;
}

@keyframes donutSlicePop {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }
  70% {
    opacity: 1;
    transform: scale(1.02);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.donut-arc.donut-arc-ontime {
  animation: donutSlicePop 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.05s;
}

.donut-arc.donut-arc-late {
  animation: donutSlicePop 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.12s;
}

.donut-arc.donut-arc-leave {
  animation: donutSlicePop 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.19s;
}

.donut-arc.donut-arc-absent {
  animation: donutSlicePop 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.26s;
}

.donut-arc:hover {
  stroke-width: 13.5 !important;
  filter: drop-shadow(0 0 6px rgba(0,0,0,0.3));
}

.content-body svg circle {
  transition: stroke-width 0.25s ease, stroke 0.25s ease, filter 0.25s ease;
  transform-origin: center;
}

/* Donut Slice Staggered Animation */
.content-body svg circle[stroke-dasharray]:nth-child(1) { animation-delay: 0.05s; }
.content-body svg circle[stroke-dasharray]:nth-child(2) { animation-delay: 0.12s; }
.content-body svg circle[stroke-dasharray]:nth-child(3) { animation-delay: 0.19s; }
.content-body svg circle[stroke-dasharray]:nth-child(4) { animation-delay: 0.26s; }

/* Donut Slice Hover Interaction */
.content-body svg circle[stroke-dasharray]:hover {
  stroke-width: 6;
  filter: drop-shadow(0 0 6px rgba(0,0,0,0.25));
  cursor: pointer;
}

/* ── Horizontal Progress Bars Animation (9999px pill containers) ── */
.content-body [style*="border-radius: 9999px"] > [style*="width:"],
.content-body [style*="border-radius: 9999px"] > [style*="width :"] {
  transform-origin: left center;
  animation: progressFillRight 0.75s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.12s;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Micro-interactions on hover ── */
.hz-card {
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.content-body .hz-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.09);
}

/* ── Button press micro-feedback ── */
.btn {
  transition: all 0.15s cubic-bezier(0.22, 1, 0.36, 1);
}
.btn:active {
  transform: scale(0.96);
}

/* ── Nav Items subtle entrance ── */
.sidebar-menu-scroll .nav-item {
  animation: agy-fadeIn 0.3s ease both;
}

/* ── Respect user preference for reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===========================================================================
   REFERENCE SYSTEM: ADMINISTRATIVE LISTS, FORMS AND APPROVALS
   =========================================================================== */
.reference-page { max-width: 100%; }
.reference-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.reference-page-heading { display: flex; align-items: flex-start; gap: 11px; }
.reference-page-icon { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 6px; background: #f1ebfb; color: #7741ce; flex: 0 0 auto; }
.reference-page h1 { margin: 0; color: var(--text-primary); font-size: 20px; font-weight: 600; letter-spacing: -0.25px; line-height: 1.3; }
.reference-page-heading p, .reference-card-toolbar p, .reference-modal-header p { margin: 3px 0 0; color: var(--text-secondary); font-size: 13px; line-height: 1.45; }
.reference-page-actions, .reference-modal-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.reference-button { display: inline-flex; min-height: 32px; align-items: center; justify-content: center; gap: 6px; padding: 6px 11px; border: 1px solid transparent; border-radius: 5px; font-size: 12.5px; font-weight: 500; line-height: 18px; cursor: pointer; }
.reference-button.primary { background: var(--brand-primary); color: #fff; }
.reference-button.primary:hover { background: var(--brand-primary-hover); }
.reference-button.secondary { background: #fff; border-color: var(--border-light); color: var(--text-secondary); }
.reference-button.secondary:hover { background: #f8f6fb; color: var(--text-primary); }
.reference-workflow { display: flex; margin: 0 0 20px; padding: 13px 16px; overflow-x: auto; border: 1px solid var(--border-subtle); border-radius: 7px; background: #fff; list-style: none; }
.reference-workflow li { display: flex; min-width: max-content; align-items: center; color: var(--text-secondary); font-size: 12px; }
.reference-workflow li:not(:last-child)::after { width: 48px; height: 1px; margin: 0 10px; background: #ddd5e9; content: ''; }
.reference-workflow span { display: inline-flex; width: 21px; height: 21px; align-items: center; justify-content: center; margin-right: 7px; border-radius: 50%; background: #eee8f7; color: #6433b6; font-size: 11px; font-weight: 600; }
.reference-workflow .done { color: #4b4260; }
.reference-workflow .done span { background: #8857e8; color: #fff; }
.reference-card { overflow: hidden; border: 1px solid transparent; border-radius: 1.375rem; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 14px -2px rgba(0, 0, 0, 0.025); }
.reference-card-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--border-subtle); }
.reference-card-toolbar h2 { margin: 0; color: var(--text-primary); font-size: 15px; font-weight: 600; }
.reference-search { display: flex; width: min(280px, 42vw); min-height: 32px; align-items: center; gap: 7px; padding: 0 9px; border: 1px solid var(--border-light); border-radius: 5px; color: var(--text-muted); }
.reference-search input { width: 100%; border: 0; outline: 0; color: var(--text-primary); font-size: 12.5px; }
.reference-table-wrap { width: 100%; overflow-x: auto; }
.reference-table { width: 100%; min-width: 700px; border-collapse: collapse; text-align: left; }
.reference-table th { padding: 10px 14px; background: #fbfafe; border-bottom: 1px solid var(--border-subtle); color: #777083; font-size: 11px; font-weight: 500; line-height: 16px; white-space: nowrap; }
.reference-table td { padding: 12px 14px; border-bottom: 1px solid #f0edf3; color: #373144; font-size: 12.5px; line-height: 18px; white-space: nowrap; }
.reference-table tbody tr:last-child td { border-bottom: 0; }
.reference-table tbody tr:hover { background: #fcfbfe; }
.reference-action-head, .reference-row-actions { width: 82px; text-align: right; }
.reference-status { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 500; }
.reference-status.success { background: #eaf8f1; color: #28754f; }
.reference-status.warning { background: #fff6df; color: #9a6810; }
.reference-status.danger { background: #ffeded; color: #ad3d3d; }
.reference-status.neutral { background: #f0eef3; color: #655e70; }
.reference-icon-button { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; margin-left: 3px; border: 0; border-radius: 4px; background: transparent; color: #6c6577; cursor: pointer; }
.reference-icon-button:hover { background: #f1ecf8; color: #6936bb; }
.reference-icon-button.approve { color: #2e8a5b; }
.reference-empty { padding: 32px; color: var(--text-secondary); font-size: 13px; text-align: center; }
.reference-modal { min-width: min(560px, calc(100vw - 32px)); padding: 20px; }
.reference-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.reference-modal-header h2 { margin: 0; color: var(--text-primary); font-size: 17px; font-weight: 600; }
.reference-modal form { display: grid; gap: 14px; }
.reference-modal label { display: grid; gap: 6px; color: #4b4557; font-size: 12px; font-weight: 500; }
.reference-modal input, .reference-modal textarea { width: 100%; padding: 8px 9px; border: 1px solid var(--border-light); border-radius: 5px; background: #fff; color: var(--text-primary); font-size: 13px; font-weight: 400; resize: vertical; }
.reference-modal-actions { justify-content: flex-end; margin-top: 4px; }
.reference-detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.reference-detail-list div { padding: 10px; border-radius: 5px; background: #faf9fc; }
.reference-detail-list dt { color: var(--text-muted); font-size: 11px; }
.reference-detail-list dd { margin: 3px 0 0; color: var(--text-primary); font-size: 13px; font-weight: 500; }

@media (max-width: 700px) {
  .reference-page-header, .reference-card-toolbar { align-items: stretch; flex-direction: column; }
  .reference-page-actions { width: 100%; }
  .reference-page-actions .reference-button { flex: 1; }
  .reference-search { width: 100%; }
  .reference-detail-list { grid-template-columns: 1fr; }
  .reference-modal { min-width: 0; width: 100%; }
}

/* ===========================================================================
   HR CONTROL PANEL — reference dashboard
   =========================================================================== */
.reference-dashboard { max-width: none; }
.reference-dashboard-heading { margin-bottom: 24px; }
.reference-dashboard-heading h1 { margin: 0; color: #121017; font-size: clamp(25px, 2vw, 31px); font-weight: 600; letter-spacing: -1.2px; line-height: 1.18; }
.reference-dashboard-heading p { margin: 5px 0 0; color: #6c6480; font-size: 15px; line-height: 21px; }
.reference-dashboard-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.reference-stat-card { min-height: 105px; padding: 16px 19px; border: 1px solid transparent; border-radius: 1.375rem; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 14px -2px rgba(0, 0, 0, 0.025); }
.reference-stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; color: #71688a; font-size: 12px; font-weight: 600; line-height: 17px; }
.reference-stat-icon { color: #71658b; }
.reference-stat-card > strong { display: block; margin-top: 6px; color: #121017; font-size: 25px; font-weight: 600; letter-spacing: -0.5px; line-height: 28px; }
.reference-stat-card > small { display: block; margin-top: 7px; color: #837b92; font-size: 10px; line-height: 13px; }
.reference-dashboard-overview { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; margin-bottom: 24px; }
.reference-dashboard-card { border: 1px solid transparent; border-radius: 1.375rem; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 14px -2px rgba(0, 0, 0, 0.025); }
.reference-dashboard-card h2 { margin: 0; color: #1c1822; font-size: 16px; font-weight: 600; letter-spacing: -0.35px; line-height: 22px; }
.attendance-summary { display: flex; min-height: 292px; flex-direction: column; padding: 25px 20px; }
.reference-attendance-center { display: flex; flex: 1; align-items: center; justify-content: center; padding: 12px 0 4px; }
.reference-donut { display: grid; width: 142px; height: 142px; place-items: center; border: 16px solid #f3f2f5; border-radius: 50%; background: #fff; }
.reference-donut > div { display: grid; justify-items: center; }
.reference-donut strong { color: #0f0d12; font-size: 27px; font-weight: 600; line-height: 30px; }
.reference-donut span { margin-top: 4px; color: #756b8c; font-size: 10px; font-weight: 600; }
.reference-attendance-legend { display: flex; justify-content: center; gap: 15px; margin: 6px 0 15px; padding: 0; list-style: none; color: #18151d; font-size: 10px; }
.reference-attendance-legend li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.reference-attendance-legend li span { width: 16px; height: 10px; }
.reference-attendance-legend .present { background: #12c982; }
.reference-attendance-legend .late { background: #f4a100; }
.reference-attendance-legend .absent { background: #ec3d68; }
.reference-attendance-legend .leave { background: #3676ef; }
.leave-summary { min-height: 332px; padding: 25px 20px 16px; }
.reference-leave-row { margin-top: 16px; }
.reference-leave-row > div:first-child, .reference-leave-debt { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.reference-leave-row span, .reference-leave-debt span { color: #6b6380; font-size: 12px; }
.reference-leave-row strong, .reference-leave-debt strong { color: #151117; font-size: 14px; font-weight: 600; }
.reference-leave-track { height: 9px; margin-top: 9px; overflow: hidden; border-radius: 999px; background: #f2f0f4; }
.reference-leave-track i { display: block; height: 100%; border-radius: inherit; background: #7e3bed; }
.reference-leave-total { display: grid; justify-items: center; margin-top: 22px; padding: 16px; border: 1px solid #c3f1dd; border-radius: 12px; background: #edfff5; color: #00885b; }
.reference-leave-total span { font-size: 10px; font-weight: 600; }
.reference-leave-total strong { margin-top: 4px; color: #007a50; font-size: 25px; font-weight: 600; line-height: 29px; }
.reference-leave-total small { margin-top: 4px; color: #3eaf87; font-size: 10px; }
.reference-leave-debt { margin-top: 19px; padding-top: 10px; border-top: 1px solid #e6e1ea; }
.reference-leave-debt strong { color: #716789; font-size: 12px; font-weight: 500; }
.reference-company-leave { min-height: 420px; padding: 26px 20px 16px; }
.reference-company-leave-chart { width: min(100%, 1020px); margin: 36px auto 0; }
.reference-leave-chart { display: block; width: 100%; height: auto; overflow: visible; }
.reference-chart-line { stroke: #ded9e6; stroke-width: 1; }
.reference-chart-dash { stroke: #d8d1e3; stroke-width: 1; stroke-dasharray: 4 4; }
.reference-chart-axis-line { stroke: #bcb4c8; stroke-width: 1.15; }
.reference-chart-axis, .reference-chart-month { fill: #736989; font-family: var(--font-sans); font-size: 14px; }

.reference-dashboard-insights { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; margin-top: 24px; }
.company-attendance-card, .personal-attendance-card, .churn-rate-card { min-height: 292px; padding: 25px 20px; }
.company-attendance-visual { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 0.75rem 0.25rem 0.25rem; }
.personal-attendance-card .company-attendance-visual, .attendance-visual--personal { flex-direction: column; align-items: center; gap: 18px; padding: 0.5rem 0.25rem 0.25rem; }
.company-attendance-donut-wrap { position: relative; display: flex; align-items: center; justify-content: center; width: 160px; height: 160px; flex-shrink: 0; }
.personal-attendance-card .company-attendance-donut-wrap, .attendance-visual--personal .company-attendance-donut-wrap { width: 140px; height: 140px; margin: 0 auto; }
.company-attendance-donut-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.company-attendance-breakdown { display: flex; flex-direction: column; gap: 12px; flex: 1; margin: 0; padding: 0; list-style: none; }
.personal-attendance-card .company-attendance-breakdown, .attendance-visual--personal .company-attendance-breakdown { width: 100%; gap: 10px; }
.company-attendance-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.personal-attendance-card .company-attendance-item, .attendance-visual--personal .company-attendance-item { width: 100%; }
.company-attendance-item-left { display: flex; align-items: center; gap: 8px; }
.company-attendance-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.company-attendance-label { color: var(--color-text); font-size: 13px; font-weight: 550; }
.company-attendance-item-right { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.company-attendance-value { color: var(--color-text); font-size: 13px; font-weight: 700; }
.company-attendance-sep { color: var(--color-text-muted); font-size: 13px; }
.company-attendance-percent { color: var(--color-text-muted); font-size: 13px; font-weight: 500; min-width: 2rem; text-align: right; }
.churn-rate-card { display: flex; flex-direction: column; }
.churn-rate-value { display: grid; justify-items: center; margin: auto 0 21px; padding-top: 20px; }
.churn-rate-value strong { color: #151117; font-size: 46px; font-weight: 600; letter-spacing: -1.5px; line-height: 52px; }
.churn-rate-value span { margin-top: 5px; color: #756d82; font-size: 12px; }
.churn-rate-track { height: 10px; overflow: hidden; border-radius: 999px; background: #f2f0f4; }
.churn-rate-track i { display: block; height: 100%; border-radius: inherit; background: #7e3bed; }
.churn-rate-details { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0 0; }
.churn-rate-details div { padding: 10px 11px; border-radius: 8px; background: #faf9fc; }
.churn-rate-details dt { color: #776f83; font-size: 11px; }
.churn-rate-details dd { margin: 3px 0 0; color: #1d1823; font-size: 16px; font-weight: 600; }
.daily-late-card { min-height: 353px; margin-top: 24px; padding: 25px 20px 17px; }
.daily-late-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.daily-late-heading p { margin: 4px 0 0; color: #756d83; font-size: 12px; }
.daily-late-status { display: inline-flex; min-height: 24px; align-items: center; padding: 2px 9px; border-radius: 999px; background: #ecfff5; color: #007c51; font-size: 11px; font-weight: 600; white-space: nowrap; }
.late-employees-chart { display: grid; grid-template-columns: 25px 1fr; min-height: 235px; margin: 28px auto 0; width: min(100%, 1040px); }
.late-y-axis { display: grid; grid-template-rows: repeat(5, 1fr); align-items: end; padding-bottom: 24px; color: #756d83; font-size: 11px; text-align: right; }
.late-plot { position: relative; display: grid; grid-template-rows: repeat(5, 1fr); padding-bottom: 24px; }
.late-grid-line { border-top: 1px solid #e3dfe9; }
.late-grid-line:last-of-type { border-bottom: 1px solid #c9c2d1; }
.late-bars { position: absolute; inset: 0 0 0 0; display: grid; grid-template-columns: repeat(7, 1fr); align-items: end; padding-bottom: 0; }
.late-bar-group { display: grid; height: 100%; align-items: end; justify-items: center; }
.late-empty-bar { width: 30px; height: 2px; margin-bottom: 24px; border-radius: 2px; background: #e9e5ee; }
.late-bar-group small { position: absolute; bottom: 0; color: #756d83; font-size: 11px; }
.late-bar-group { position: relative; }
.workflow-guide { margin-top: 24px; padding: 25px 20px; }
.workflow-guide-heading p { margin: 4px 0 0; color: #756d83; font-size: 12px; }
.workflow-guide-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 19px; }
.workflow-guide-item { overflow: hidden; border: 1px solid #e7e2eb; border-radius: 8px; background: #fff; }
.workflow-guide-trigger { display: flex; width: 100%; min-height: 64px; align-items: center; gap: 10px; padding: 11px 12px; border: 0; background: transparent; color: inherit; cursor: pointer; text-align: left; }
.workflow-guide-trigger:hover { background: #fcfbfe; }
.workflow-guide-marker { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 6px; background: #f1ebfb; color: #7138cf; font-size: 11px; font-weight: 600; flex: 0 0 auto; }
.workflow-guide-copy { display: grid; min-width: 0; gap: 2px; flex: 1; }
.workflow-guide-copy strong { color: #211c29; font-size: 13px; font-weight: 600; line-height: 17px; }
.workflow-guide-copy small { overflow: hidden; color: #776f83; font-size: 11px; line-height: 15px; text-overflow: ellipsis; white-space: nowrap; }
.workflow-guide-chevron { color: #81798d; font-size: 19px; transition: transform var(--transition-fast); }
.workflow-guide-item.is-open .workflow-guide-chevron { transform: rotate(90deg); color: #7138cf; }
.workflow-guide-steps { display: none; gap: 0; margin: 0; padding: 0 12px 12px 50px; list-style: none; }
.workflow-guide-item.is-open .workflow-guide-steps { display: grid; }
.workflow-guide-steps li { position: relative; min-height: 27px; padding: 5px 0 5px 19px; border-left: 1px solid #dfd8e9; color: #5d5669; font-size: 11px; line-height: 16px; }
.workflow-guide-steps li:last-child { padding-bottom: 0; }
.workflow-guide-steps li > span { position: absolute; left: -7px; top: 7px; display: inline-flex; width: 13px; height: 13px; align-items: center; justify-content: center; border-radius: 50%; background: #8857e8; color: #fff; font-size: 8px; font-weight: 600; }

@media (max-width: 1200px) {
  .reference-dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reference-dashboard-overview { grid-template-columns: 1fr; }
  .reference-dashboard-insights { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .reference-dashboard-heading { margin-bottom: 18px; }
  .reference-dashboard-heading p { font-size: 14px; }
  .reference-dashboard-stats { grid-template-columns: 1fr; gap: 10px; margin-bottom: 16px; }
  .reference-stat-card { min-height: 96px; }
  .reference-dashboard-overview { gap: 12px; margin-bottom: 16px; }
  .attendance-summary { min-height: 305px; padding-top: 24px; }
  .reference-attendance-legend { flex-wrap: wrap; gap: 9px; }
  .reference-company-leave { min-height: 300px; padding: 20px 12px; }
  .reference-company-leave-chart { min-width: 620px; margin-top: 22px; }
  .reference-company-leave { overflow-x: auto; }
  .company-attendance-card, .churn-rate-card { min-height: 260px; }
  .company-attendance-visual { gap: 24px; }
  .workflow-guide { padding: 20px 12px; }
  .workflow-guide-list { grid-template-columns: 1fr; }
  .daily-late-heading { align-items: stretch; flex-direction: column; }
  .daily-late-status { width: fit-content; }
}
