/* ================================================================
   IMB Services – Additional Utilities & Components
================================================================ */

/* ── Mark Attendance Button ── */
.attendance-hero {
  background: var(--grad-brand);
  border-radius: var(--radius-lg);
  padding: 30px;
  color: #fff;
  text-align: center;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-brand);
}
.attendance-hero::before {
  content: '';
  position: absolute; top: -60px; right: -40px;
  width: 150px; height: 150px;
  background: rgba(255,255,255,0.10);
  border-radius: 50%;
}
.attendance-hero::after {
  content: '';
  position: absolute; bottom: -70px; left: -30px;
  width: 180px; height: 180px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}
.mark-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  color: var(--primary);
  border: none;
  padding: 16px 40px;
  border-radius: 100px;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  margin-top: 20px;
  transition: var(--transition);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  position: relative;
  z-index: 1;
  text-decoration: none;
}
.mark-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.2);
  color: var(--primary-dark);
}
.already-marked {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
  padding: 14px 32px;
  border-radius: 100px;
  font-size: 1rem;
  font-weight: 700;
  margin-top: 20px;
}

/* ── Top Employees List ── */
.employee-rank {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.employee-rank:last-child { border-bottom: none; }
.rank-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700; font-size: 0.78rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.rank-name { flex: 1; font-weight: 600; font-size: 0.875rem; }
.rank-amount { font-weight: 700; color: var(--success); font-size: 0.875rem; }

/* ── Login Page Illustration ── */
.login-illustration {
  position: absolute;
  top: 20px; left: 20px;
  opacity: 0.5;
  pointer-events: none;
}

/* ── Modal ── */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.25s ease;
  margin: 20px;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title { font-size: 1.05rem; font-weight: 700; }
.modal-close {
  background: none; border: none;
  font-size: 1.3rem; cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ── Today Status Widget ── */
.today-status {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 24px;
  background: var(--bg-hover);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.status-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.status-dot.present  { background: var(--success); box-shadow: 0 0 0 4px rgba(16,185,129,0.15); }
.status-dot.late     { background: var(--orange); box-shadow: 0 0 0 4px rgba(249,115,22,0.15); }
.status-dot.absent   { background: var(--danger); box-shadow: 0 0 0 4px rgba(239,68,68,0.15); }
.status-dot.holiday  { background: var(--accent); box-shadow: 0 0 0 4px rgba(139,92,246,0.15); }
.status-dot.leave    { background: var(--info); box-shadow: 0 0 0 4px rgba(59,130,246,0.15); }
.status-dot.none     { background: var(--text-muted); }

/* ── Upcoming Holidays Widget ── */
.holiday-item {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.holiday-item:last-child { border-bottom: none; }
.holiday-date-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 800; font-size: 0.75rem;
  padding: 6px 14px; border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.holiday-name { font-weight: 600; font-size: 0.875rem; }
.holiday-type { font-size: 0.72rem; color: var(--text-secondary); }

/* ── Animated Number ── */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.stat-value { animation: countUp 0.5s ease both; }

/* ── Sidebar active indicator pulse ── */
.nav-item.active .nav-icon {
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.4));
}



/* ── Quick action cards ── */
.quick-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.quick-action {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer; text-decoration: none;
  transition: var(--transition);
  color: var(--text-primary);
  font-weight: 600; font-size: 0.82rem;
  box-shadow: var(--shadow-sm);
}
.quick-action:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.quick-action-icon { font-size: 1.6rem; margin-bottom: 2px; }

/* ── Data highlight ── */
.highlight-row { background: #FFFBEB !important; }
/* ── Window Closed Message ── */
.window-closed-msg {
  display: inline-flex;
  align-items: center;
  gap: 15px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 16px 24px;
  border-radius: var(--radius-lg);
  margin-top: 16px;
  text-align: left;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}
.window-closed-msg i {
  font-size: 1.5rem;
  opacity: 0.9;
}
.window-closed-msg strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 2px;
}
.window-closed-msg p {
  margin: 0;
  font-size: 0.78rem;
  opacity: 0.85;
}

/* ── Attendance Status Card State Classes ── */
/* Completed states read as a clean white card with a coloured accent bar,
   not a big pastel blob. */
.attendance-hero[class*="status-"] {
  background: #fff !important;
  border-radius: var(--radius-lg);
  padding: 22px 26px !important;
  box-shadow: var(--shadow) !important;
  border: 1px solid var(--border) !important;
  border-top: 3px solid var(--state-color, var(--primary)) !important;
}
.attendance-hero.status-present { --state-color: #16A34A; color: #15803D !important; }
.attendance-hero.status-late    { --state-color: #F97316; color: #C2410C !important; }
.attendance-hero.status-absent  { --state-color: #EF4444; color: #B91C1C !important; }

.attendance-hero[class*="status-"] .mark-btn,
.attendance-hero[class*="status-"] .window-closed-msg { display: none; }
.attendance-hero[class*="status-"] .status-display { padding: 4px 0; }
/* The little "Today's Attendance" caption above the status */
.attendance-hero[class*="status-"] .status-display > div:first-child {
  color: var(--text-secondary) !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem !important;
}
.attendance-hero[class*="status-"] i { opacity: 1; color: inherit !important; }
/* Status label ("Late", "Present"…) sits big in the state colour */
.attendance-hero[class*="status-"] .already-marked {
  background: transparent !important;
  color: var(--state-color, var(--primary)) !important;
  border: none !important;
  padding: 6px 0 0 !important;
  margin-top: 8px !important;
  font-weight: 800 !important;
}
/* The In / Out / Dur pill inside the status group */
.attendance-hero[class*="status-"] .already-marked > div:nth-child(2) {
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
}
/* Kill the decorative circles on the white card — they only suit the gradient */
.attendance-hero[class*="status-"]::before,
.attendance-hero[class*="status-"]::after { display: none; }


/* ── Status Tracking Timeline ── */
.status-timeline {
  display: flex;
  align-items: center;
  min-width: 220px;
  justify-content: center;
  margin: 5px 0;
}
.timeline-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 70px;
  position: relative;
  z-index: 2;
}
.node-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.75rem;
  background: #9CA3AF; /* default grey */
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #E5E7EB;
}
.node-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
  margin-top: 6px;
  color: var(--text-primary);
  line-height: 1.2;
}
.node-status {
  font-size: 0.6rem;
  font-weight: 500;
  display: block;
  color: var(--text-secondary);
}
/* Review note preview in a list row: always exactly one line, ellipsised.
   The full note lives in the sale's View popup (and in the title tooltip). */
.note-line {
  font-size: 0.68rem;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Who made this decision, and when — shown under the node's status. */
.node-actor {
  font-size: 0.55rem;
  font-weight: 500;
  display: block;
  margin-top: 1px;
  color: var(--text-muted, #9CA3AF);
  white-space: nowrap;
}
.timeline-line {
  flex: 1;
  height: 3px;
  background: #E5E7EB; /* grey line */
  margin: 0 -15px;
  margin-top: -24px;
  z-index: 1;
}

/* Specific States */
.state-pending .node-circle { background: #9CA3AF; box-shadow: 0 0 0 1px #9CA3AF; }
.state-approved .node-circle { background: #10B981; box-shadow: 0 0 0 1px #10B981; }
.state-cancelled .node-circle { background: #EF4444; box-shadow: 0 0 0 1px #EF4444; }
.state-escalated .node-circle { background: #F97316; box-shadow: 0 0 0 1px #F97316; }

.state-pending .node-status { color: #6B7280; }
.state-approved .node-status { color: #059669; }
.state-cancelled .node-status { color: #DC2626; }
.state-escalated .node-status { color: #C2410C; }

.state-disabled { opacity: 0.4; filter: grayscale(1); }

.line-green { background: #10B981; }
.line-red { background: #EF4444; }
