/* ==========================================
   APEXLOGIX CSS CORE SYSTEM & VARIABLES
   ========================================== */

:root {
  --font-family: 'Outfit', sans-serif;
  color-scheme: dark;
  
  /* Color Palette */
  --bg-dark: #070a13;
  --bg-darker: #04060c;
  --panel-bg: rgba(17, 24, 39, 0.7);
  --panel-border: rgba(255, 255, 255, 0.08);
  
  --accent-color: #38bdf8;       /* Sky Blue */
  --accent-glow: rgba(56, 189, 248, 0.3);
  
  --color-present: #10b981;     /* Emerald Green */
  --color-present-glow: rgba(16, 185, 129, 0.2);
  
  --color-late: #f59e0b;        /* Amber Yellow */
  --color-late-glow: rgba(245, 158, 11, 0.2);
  
  --color-absent: #ef4444;      /* Coral Red */
  --color-absent-glow: rgba(239, 68, 68, 0.2);
  
  --color-excused: #6366f1;     /* Indigo */
  --color-excused-glow: rgba(99, 102, 241, 0.2);

  --color-unlogged: #4b5563;    /* Cool Grey */
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  /* Typography Scale */
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-xxl: 1.5rem;
  --fs-title: 2rem;

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-circle: 50%;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   RESET & UTILITY CLASSES
   ========================================== */

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  position: relative;
}

/* Ambient glow backgrounds */
.ambient-glow {
  position: absolute;
  border-radius: var(--radius-circle);
  filter: blur(140px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
}

.glow-1 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--accent-color) 0%, transparent 70%);
  top: -100px;
  right: -50px;
}

.glow-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--color-excused) 0%, transparent 75%);
  bottom: -150px;
  left: -100px;
}

.hidden {
  display: none !important;
}

h1, h2, h3, h4, h5 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: var(--accent-color);
  text-decoration: none;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Glass panel background */
.glass-panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  transition: transform var(--transition-normal), border-color var(--transition-normal);
}

/* ==========================================
   BUTTONS & FORM INPUTS
   ========================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-color);
  color: var(--bg-darker);
}

.btn-primary:hover {
  background: #56cbf9;
  box-shadow: 0 0 15px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--color-absent);
  color: var(--text-primary);
}

.btn-danger:hover {
  background: #ff5a5a;
  box-shadow: 0 0 15px var(--color-absent-glow);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-icon-only {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: var(--radius-sm);
}

.btn-full {
  width: 100%;
}

.btn-test {
  font-size: var(--fs-xs);
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.btn-test:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-color);
}

/* Forms */
.form-group {
  margin-bottom: 18px;
  text-align: left;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.input-wrapper {
  position: relative;
  width: 100%;
}

.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 12px 10px 40px;
  border-radius: var(--radius-sm);
  outline: none;
  font-size: var(--fs-base);
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

textarea {
  padding-left: 12px; /* Textareas have no icons usually */
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

select option {
  background: #111827;
  color: var(--text-primary);
}

.static-value-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 15px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-weight: 600;
}

/* ==========================================
   APP HEADER
   ========================================== */

.app-header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(7, 10, 19, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--panel-border);
  z-index: 100;
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  background: var(--accent-glow);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.icon-accent {
  color: var(--accent-color);
  width: 22px;
  height: 22px;
}

.brand-text h1 {
  font-size: var(--fs-lg);
  line-height: 1;
}

.brand-text span {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 14px 6px 6px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-circle);
  background: var(--accent-color);
  color: var(--bg-darker);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--fs-sm);
}

.user-details {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.user-name {
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.2;
}

.user-role {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  line-height: 1.1;
}

/* ==========================================
   MAIN LAYOUT & VIEWS
   ========================================== */

.main-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
  min-height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
}

.view-section {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  animation: fadeIn var(--transition-normal) forwards;
}

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

/* ==========================================
   1. LOGIN VIEW
   ========================================== */

#view-login {
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 40px 30px;
  text-align: center;
  border-radius: var(--radius-lg);
}

.login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: var(--accent-glow);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.login-logo i {
  color: var(--accent-color);
  width: 30px;
  height: 30px;
}

.login-header h2 {
  font-size: var(--fs-xxl);
  margin-bottom: 6px;
}

.login-header p {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.test-accounts {
  margin-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 20px;
}

.test-title {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  display: block;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.test-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ==========================================
   2. MECHANIC DASHBOARD VIEW
   ========================================== */

.dashboard-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
}

.col-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.col-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Profile Widget */
.profile-widget {
  padding: 30px 20px;
  text-align: center;
}

.profile-main {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.avatar-large {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-circle);
  background: linear-gradient(135deg, var(--accent-color), var(--color-excused));
  color: var(--bg-darker);
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.2);
  margin-bottom: 16px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.profile-main h3 {
  font-size: var(--fs-xl);
  margin-bottom: 4px;
}

.profile-main .specialty {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.badge {
  display: inline-flex;
  padding: 4px 10px;
  font-size: var(--fs-xs);
  font-weight: 700;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-primary {
  background: var(--accent-glow);
  color: var(--accent-color);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Punch Card */
.punch-card {
  padding: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: var(--fs-lg);
  color: var(--text-primary);
}

.card-header i {
  color: var(--accent-color);
  width: 20px;
  height: 20px;
}

.punch-status-display {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.status-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-circle);
  background: var(--color-unlogged);
}

.status-indicator-dot.active {
  background: var(--color-present);
  box-shadow: 0 0 10px var(--color-present);
  animation: pulse 1.8s infinite;
}

.status-indicator-dot.delayed {
  background: var(--color-late);
  box-shadow: 0 0 10px var(--color-late);
  animation: pulse 1.8s infinite;
}

.status-indicator-dot.inactive {
  background: var(--color-absent);
  box-shadow: 0 0 10px var(--color-absent);
}

.status-indicator-dot.excused {
  background: var(--color-excused);
  box-shadow: 0 0 10px var(--color-excused);
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

#punch-status-text {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-primary);
}

.section-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-secondary);
}

.status-radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.status-radio-card {
  position: relative;
  cursor: pointer;
}

.status-radio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.status-radio-card .radio-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all var(--transition-fast);
  text-align: center;
  gap: 6px;
}

.status-radio-card .radio-content i {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

.status-radio-card .radio-content span {
  font-size: var(--fs-xs);
  font-weight: 600;
}

/* Radio Cards Selection States */
.status-radio-card.present input:checked + .radio-content {
  border-color: var(--color-present);
  background: var(--color-present-glow);
}
.status-radio-card.present input:checked + .radio-content i {
  color: var(--color-present);
}

.status-radio-card.late input:checked + .radio-content {
  border-color: var(--color-late);
  background: var(--color-late-glow);
}
.status-radio-card.late input:checked + .radio-content i {
  color: var(--color-late);
}

.status-radio-card.absent input:checked + .radio-content {
  border-color: var(--color-absent);
  background: var(--color-absent-glow);
}
.status-radio-card.absent input:checked + .radio-content i {
  color: var(--color-absent);
}

.status-radio-card.excused input:checked + .radio-content {
  border-color: var(--color-excused);
  background: var(--color-excused-glow);
}
.status-radio-card.excused input:checked + .radio-content i {
  color: var(--color-excused);
}

.punch-action-buttons {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stats-card {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-unlogged);
}

.stats-card.border-present { border-left-color: var(--color-present); }
.stats-card.border-late { border-left-color: var(--color-late); }
.stats-card.border-absent { border-left-color: var(--color-absent); }
.stats-card.border-accent { border-left-color: var(--accent-color); }

.stats-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stats-icon i {
  width: 22px;
  height: 22px;
}

.text-present { color: var(--color-present); }
.text-late { color: var(--color-late); }
.text-absent { color: var(--color-absent); }
.text-accent { color: var(--accent-color); }

.stats-info {
  display: flex;
  flex-direction: column;
}

.stats-title {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.2;
}

.stats-value {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.stats-desc {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* Calendar styling */
.calendar-section {
  padding: 24px;
}

.calendar-header-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.calendar-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-lg);
}

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.calendar-current-month {
  font-size: var(--fs-base);
  font-weight: 600;
  min-width: 110px;
  text-align: center;
}

.calendar-grid-wrapper {
  display: flex;
  flex-direction: column;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-weight: 600;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 10px;
}

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

.calendar-day-cell {
  aspect-ratio: 1.1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 8px 4px 4px 4px;
  position: relative;
  transition: all var(--transition-fast);
}

.calendar-day-cell:not(.empty-day) {
  cursor: pointer;
}

.calendar-day-cell:not(.empty-day):hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.calendar-day-cell.empty-day {
  background: transparent;
  border: none;
}

.calendar-day-number {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.calendar-day-status-indicator {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-circle);
  background: transparent;
}

/* Day Cell Attendance State Stylings */
.calendar-day-cell.present-day {
  border-bottom: 3px solid var(--color-present);
  background: rgba(16, 185, 129, 0.05);
}
.calendar-day-cell.present-day .calendar-day-status-indicator {
  background: var(--color-present);
}

.calendar-day-cell.late-day {
  border-bottom: 3px solid var(--color-late);
  background: rgba(245, 158, 11, 0.05);
}
.calendar-day-cell.late-day .calendar-day-status-indicator {
  background: var(--color-late);
}

.calendar-day-cell.absent-day {
  border-bottom: 3px solid var(--color-absent);
  background: rgba(239, 68, 68, 0.05);
}
.calendar-day-cell.absent-day .calendar-day-status-indicator {
  background: var(--color-absent);
}

.calendar-day-cell.excused-day {
  border-bottom: 3px solid var(--color-excused);
  background: rgba(99, 102, 241, 0.05);
}
.calendar-day-cell.excused-day .calendar-day-status-indicator {
  background: var(--color-excused);
}

.calendar-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  font-weight: 500;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-color.present { background-color: var(--color-present); }
.legend-color.late { background-color: var(--color-late); }
.legend-color.absent { background-color: var(--color-absent); }
.legend-color.excused { background-color: var(--color-excused); }
.legend-color.unlogged { background-color: var(--color-unlogged); }

/* Trends Graph */
.trends-section {
  padding: 24px;
}

.chart-container {
  height: 200px;
  margin-top: 25px;
  padding: 0 10px;
  display: flex;
  align-items: flex-end;
}

.chart-bars-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.chart-bar-column {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 50px;
}

.chart-bar-visual-wrapper {
  height: 140px;
  width: 24px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.chart-bar-fill {
  background: linear-gradient(180deg, var(--accent-color) 0%, rgba(56, 189, 248, 0.4) 100%);
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
  transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-bar-fill.empty-fill {
  background: transparent;
  box-shadow: none;
}

.chart-bar-label {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 8px;
}

.chart-bar-value {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

/* ==========================================
   3. ADMIN DASHBOARD VIEW
   ========================================== */

.admin-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.admin-header-row h2 {
  font-size: var(--fs-title);
}

.admin-stats {
  margin-bottom: 24px;
}

.admin-roster-panel {
  padding: 24px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-top: 15px;
}

.roster-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.roster-table th {
  padding: 12px 16px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.roster-table td {
  padding: 16px;
  font-size: var(--fs-base);
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.roster-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.table-loading {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: 40px !important;
}

.mechanic-cell-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mechanic-cell-details {
  display: flex;
  flex-direction: column;
}

.mechanic-cell-name {
  font-weight: 600;
}

.mechanic-cell-username {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.table-badge {
  display: inline-flex;
  padding: 4px 8px;
  font-size: var(--fs-xs);
  font-weight: 700;
  border-radius: 6px;
}

.table-badge.present { background: var(--color-present-glow); color: var(--color-present); border: 1px solid rgba(16, 185, 129, 0.3); }
.table-badge.late { background: var(--color-late-glow); color: var(--color-late); border: 1px solid rgba(245, 158, 11, 0.3); }
.table-badge.absent { background: var(--color-absent-glow); color: var(--color-absent); border: 1px solid rgba(239, 68, 68, 0.3); }
.table-badge.excused { background: var(--color-excused-glow); color: var(--color-excused); border: 1px solid rgba(99, 102, 241, 0.3); }
.table-badge.unlogged { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); border: 1px solid rgba(255, 255, 255, 0.1); }

.comment-cell-text {
  max-width: 250px;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actions-cell-group {
  display: flex;
  gap: 8px;
}

/* ==========================================
   MODAL WINDOW STYLING
   ========================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 6, 12, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 500px;
  padding: 30px;
  position: relative;
  animation: modalScaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.modal-large {
  max-width: 850px;
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-title-group h3 {
  font-size: var(--fs-lg);
}

.btn-close-modal {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.btn-close-modal:hover {
  color: var(--text-primary);
}

.modal-footer {
  margin-top: 30px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Mechanic Detail Report Content styling */
.report-modal-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.report-meta-header {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 20px;
}

.report-meta-header .meta-desc {
  flex-grow: 1;
}

.report-meta-header h4 {
  font-size: var(--fs-xl);
}

.report-meta-header p {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

.report-year-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-year-picker select {
  padding: 6px 12px 6px 12px;
  width: auto;
}

.report-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.report-stats .stats-card {
  padding: 12px 16px;
}

.report-body-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  align-items: start;
}

.report-calendar-col {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  padding: 16px;
}

.report-logs-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 310px;
}

.report-logs-col h5 {
  font-size: var(--fs-base);
}

.report-logs-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 270px;
  padding-right: 4px;
}

.report-log-item {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.log-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.log-item-date {
  font-weight: 600;
  font-size: var(--fs-sm);
}

.log-item-times {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.log-item-comments {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}

.log-item-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 40px 0;
  font-style: italic;
  font-size: var(--fs-sm);
}

/* Day details modal values */
.day-details-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 0;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
}

.detail-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.detail-val {
  font-weight: 500;
}

.detail-comment-box {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-top: 5px;
}

.detail-comment-box p {
  font-size: var(--fs-sm);
  color: var(--text-primary);
  margin-top: 4px;
  word-break: break-word;
}

/* ==========================================
   TOAST NOTIFICATION COMPONENT
   ========================================== */

.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  box-shadow: 0 5px 20px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 400px;
  backdrop-filter: blur(10px);
  animation: toastSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transition: opacity 0.3s ease;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast-success { border-left: 4px solid var(--color-present); }
.toast-success .toast-icon { color: var(--color-present); }

.toast-error { border-left: 4px solid var(--color-absent); }
.toast-error .toast-icon { color: var(--color-absent); }

.toast-warning { border-left: 4px solid var(--color-late); }
.toast-warning .toast-icon { color: var(--color-late); }

.toast-info { border-left: 4px solid var(--accent-color); }
.toast-info .toast-icon { color: var(--accent-color); }

.toast-message {
  font-size: var(--fs-sm);
  font-weight: 500;
  flex-grow: 1;
}

/* ==========================================
   RESPONSIVE MEDIA BREAKPOINTS
   ========================================== */

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .col-sidebar {
    flex-direction: row;
    align-items: stretch;
  }
  
  .profile-widget {
    flex: 1 1 300px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .punch-card {
    flex: 2 1 450px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .report-body-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .col-sidebar {
    flex-direction: column;
  }
  
  .header-container {
    padding: 12px 16px;
  }
  
  .main-container {
    padding: 16px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .calendar-weekdays span {
    font-size: var(--fs-xs);
  }
  
  .calendar-day-cell {
    padding: 4px 2px;
  }
  
  .calendar-day-number {
    font-size: var(--fs-xs);
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .admin-mgmt-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================
   PRELOADER COMPONENT
   ========================================== */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #070a13;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  opacity: 1;
  visibility: visible;
}

.preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.preloader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.preloader-logo {
  width: 80px;
  height: 80px;
  background: var(--accent-glow);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  animation: preloaderPulse 2s infinite ease-in-out;
}

.preloader-icon {
  width: 44px;
  height: 44px;
  color: var(--accent-color);
  animation: preloaderSpin 8s infinite linear;
}

.preloader-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--accent-color);
  border-radius: var(--radius-circle);
  animation: preloaderSpinnerRotate 1s infinite linear;
  margin-bottom: 16px;
}

.preloader-title {
  font-size: var(--fs-xxl);
  color: var(--text-primary);
  margin-bottom: 4px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.preloader-subtitle {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  font-weight: 500;
}

@keyframes preloaderPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.1);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.3);
  }
}

@keyframes preloaderSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes preloaderSpinnerRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
