/* 
  EduFlow SaaS Educational ERP - Attendance Management Module Stylesheet
  --------------------------------------------------------------------
*/

/* Import app and design system styles */
@import url("app.css");

/* --- Main workspace grid --- */
.attendance-workspace-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  width: 100%;
}

.attendance-screen-element {
  display: none;
  width: 100%;
  animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.attendance-screen-element.active {
  display: block;
}

/* --- Status Badges and Indicators --- */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.status-present {
  background-color: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}
.status-absent {
  background-color: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}
.status-late {
  background-color: rgba(249, 115, 22, 0.12);
  color: #ea580c;
}
.status-halfday {
  background-color: rgba(168, 85, 247, 0.12);
  color: #9333ea;
}
.status-leave {
  background-color: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}
.status-holiday {
  background-color: rgba(100, 116, 139, 0.12);
  color: #475569;
}

[data-theme="dark"] .status-holiday {
  background-color: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
}

/* --- Attendance Calendar View --- */
.attendance-calendar-wrapper {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.calendar-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-5);
}

.calendar-month-title {
  font-family: var(--font-headings);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--color-text-primary);
}

.calendar-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  text-align: center;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  margin-bottom: 12px;
}

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

.calendar-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background-color: var(--color-surface-hover);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px;
  position: relative;
  transition: all var(--transition-fast);
}

.calendar-cell:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--color-primary-light);
}

.calendar-day-num {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--color-text-primary);
}

.calendar-cell.muted {
  opacity: 0.3;
}

.calendar-cell.present {
  background-color: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.3);
}
.calendar-cell.present .calendar-day-num {
  color: #16a34a;
}
.calendar-cell.present::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #22c55e;
  align-self: center;
}

.calendar-cell.absent {
  background-color: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
}
.calendar-cell.absent .calendar-day-num {
  color: #dc2626;
}
.calendar-cell.absent::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #ef4444;
  align-self: center;
}

.calendar-cell.late {
  background-color: rgba(249, 115, 22, 0.08);
  border-color: rgba(249, 115, 22, 0.3);
}
.calendar-cell.late .calendar-day-num {
  color: #ea580c;
}
.calendar-cell.late::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #f97316;
  align-self: center;
}

.calendar-cell.leave {
  background-color: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.3);
}
.calendar-cell.leave .calendar-day-num {
  color: #2563eb;
}
.calendar-cell.leave::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #3b82f6;
  align-self: center;
}

.calendar-cell.holiday {
  background-color: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.3);
}
.calendar-cell.holiday .calendar-day-num {
  color: #64748b;
}

/* --- Sparklines and Mini SVG Charts --- */
.trend-svg {
  width: 100%;
  height: 200px;
  overflow: visible;
}

.trend-line {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 800;
  stroke-dashoffset: 800;
  animation: drawLine 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.trend-area {
  fill: url(#gradient-trend);
  opacity: 0.15;
  animation: fadeIn 1s ease-in forwards;
}

.trend-grid-line {
  stroke: var(--color-border);
  stroke-width: 1;
  stroke-dasharray: 4,4;
}

.trend-dot {
  fill: var(--color-white);
  stroke: var(--color-primary);
  stroke-width: 3;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.trend-dot:hover {
  r: 7;
  fill: var(--color-accent);
}

@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

/* --- Biometric Integrations Schematics --- */
.device-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-5);
  width: 100%;
}

.device-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: all var(--transition-fast);
}

.device-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.device-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.device-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background-color: rgba(97, 61, 223, 0.08);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.device-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.device-status-online {
  background-color: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.device-status-offline {
  background-color: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.device-specs-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

.device-spec-item {
  display: flex;
  justify-content: space-between;
}

.device-spec-val {
  font-family: monospace;
  font-weight: 700;
  color: var(--color-text-primary);
}

/* --- Live log simulator feed --- */
.log-stream-wrapper {
  background-color: #0c081d;
  border-radius: var(--radius-lg);
  border: 1px solid #241655;
  padding: var(--space-4);
  height: 240px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 0.75rem;
  color: #a5b4fc;
}

.log-entry-row {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  line-height: 1.4;
  animation: slideInDown 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.log-time {
  color: #818cf8;
}

.log-tag {
  font-weight: bold;
  color: var(--color-accent);
}

.log-msg {
  color: #e0e7ff;
}

/* --- Leave Approval tree --- */
.approval-tree-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin: var(--space-5) 0;
  padding: 0 var(--space-4);
}

.approval-tree-container::before {
  content: '';
  position: absolute;
  top: 24px;
  left: var(--space-10);
  right: var(--space-10);
  height: 2px;
  background-color: var(--color-border);
  z-index: 1;
}

.approval-tree-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  position: relative;
  z-index: 2;
  width: 80px;
}

.approval-step-dot {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--color-surface);
  border: 2px solid var(--color-border);
  color: var(--color-text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.approval-tree-step.active .approval-step-dot {
  border-color: var(--color-primary);
  background-color: rgba(97, 61, 223, 0.08);
  color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(97, 61, 223, 0.15);
}

.approval-tree-step.completed .approval-step-dot {
  border-color: #22c55e;
  background-color: rgba(34, 197, 94, 0.08);
  color: #22c55e;
}

.approval-step-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-secondary);
}

.approval-tree-step.active .approval-step-label {
  color: var(--color-primary);
}

.approval-tree-step.completed .approval-step-label {
  color: #22c55e;
}

/* --- Check-In/Check-Out Portal Card --- */
.checkin-portal-card {
  max-width: 400px;
  margin: 0 auto;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
}

.digital-clock-face {
  font-family: monospace;
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--color-text-primary);
  background-color: var(--color-surface-hover);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.checkin-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

.checkin-action-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  width: 100%;
}

.checkin-log-details {
  width: 100%;
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

.checkin-log-item {
  display: flex;
  justify-content: space-between;
}

.checkin-log-val {
  font-weight: 700;
  color: var(--color-text-primary);
}
