/* V-Track Modern UI - Consolidated Styles */

/* ============================================
   BASE & SCROLLBARS
   ============================================ */

*, *::before, *::after {
  scrollbar-width: thin;
  scrollbar-color: rgb(148 163 184 / 0.3) transparent;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgb(148 163 184 / 0.3); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgb(148 163 184 / 0.5); }

/* ============================================
   NAVIGATION
   ============================================ */

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(100 116 139);
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
}

.nav-link:hover {
  color: rgb(51 65 85);
  background: rgb(241 245 249);
}

.dark .nav-link { color: rgb(148 163 184); }
.dark .nav-link:hover { color: rgb(226 232 240); background: rgb(30 41 59); }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin: 0 0.375rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(71 85 105);
  transition: all 0.15s ease;
  text-decoration: none;
}

.dropdown-item:hover { color: rgb(15 23 42); background: rgb(241 245 249); }
.dark .dropdown-item { color: rgb(203 213 225); }
.dark .dropdown-item:hover { color: rgb(248 250 252); background: rgb(51 65 85); }

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgb(71 85 105);
  transition: all 0.15s ease;
  text-decoration: none;
}

.mobile-nav-link:hover { color: rgb(99 102 241); background: rgb(238 242 255); }
.dark .mobile-nav-link { color: rgb(203 213 225); }
.dark .mobile-nav-link:hover { color: rgb(165 180 252); background: rgb(30 41 59); }

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: rgb(148 163 184);
  transition: all 0.15s ease;
  text-decoration: none;
  min-width: 3.5rem;
}

.bottom-nav-item:hover, .bottom-nav-item.active { color: rgb(99 102 241); }
.dark .bottom-nav-item:hover, .dark .bottom-nav-item.active { color: rgb(129 140 248); }

.safe-area-bottom { padding-bottom: env(safe-area-inset-bottom, 0px); }

/* ============================================
   CARDS
   ============================================ */

.card {
  background: white;
  border: 1px solid rgb(226 232 240);
  border-radius: 1rem;
  overflow: hidden;
  transition: all 0.2s ease;
}

.dark .card { background: rgb(15 23 42); border-color: rgb(30 41 59); }

.stat-card {
  padding: 1.25rem 1.5rem;
  border-radius: 1rem;
  border: 1px solid rgb(226 232 240);
  background: white;
  transition: all 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -5px rgb(0 0 0 / 0.08);
}

.dark .stat-card { background: rgb(15 23 42); border-color: rgb(30 41 59); }
.dark .stat-card:hover { box-shadow: 0 8px 25px -5px rgb(0 0 0 / 0.3); }

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.15s ease;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  border: none;
  outline: none;
}

.btn:focus-visible { outline: 2px solid rgb(99 102 241); outline-offset: 2px; }

.btn-primary {
  background: linear-gradient(135deg, rgb(99 102 241), rgb(79 70 229));
  color: white;
  box-shadow: 0 2px 8px rgb(99 102 241 / 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, rgb(79 70 229), rgb(67 56 202));
  box-shadow: 0 4px 12px rgb(99 102 241 / 0.4);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, rgb(16 185 129), rgb(4 120 87));
  color: white;
  box-shadow: 0 2px 8px rgb(16 185 129 / 0.3);
}

.btn-success:hover {
  box-shadow: 0 4px 12px rgb(16 185 129 / 0.4);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, rgb(244 63 94), rgb(190 18 60));
  color: white;
  box-shadow: 0 2px 8px rgb(244 63 94 / 0.3);
}

.btn-danger:hover {
  box-shadow: 0 4px 12px rgb(244 63 94 / 0.4);
  transform: translateY(-1px);
}

.btn-warning {
  background: linear-gradient(135deg, rgb(245 158 11), rgb(180 83 9));
  color: white;
  box-shadow: 0 2px 8px rgb(245 158 11 / 0.3);
}

.btn-warning:hover {
  box-shadow: 0 4px 12px rgb(245 158 11 / 0.4);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: rgb(100 116 139);
  border: 1px solid rgb(226 232 240);
}

.btn-ghost:hover { background: rgb(241 245 249); color: rgb(51 65 85); border-color: rgb(203 213 225); }
.dark .btn-ghost { color: rgb(148 163 184); border-color: rgb(51 65 85); }
.dark .btn-ghost:hover { background: rgb(30 41 59); color: rgb(226 232 240); border-color: rgb(71 85 105); }

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; border-radius: 0.5rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; border-radius: 0.75rem; }

.btn-icon {
  padding: 0.5rem;
  border-radius: 0.5rem;
  background: transparent;
  border: 1px solid rgb(226 232 240);
  color: rgb(100 116 139);
  transition: all 0.15s ease;
  cursor: pointer;
}

.btn-icon:hover { background: rgb(241 245 249); color: rgb(51 65 85); }
.dark .btn-icon { border-color: rgb(51 65 85); color: rgb(148 163 184); }
.dark .btn-icon:hover { background: rgb(30 41 59); color: rgb(226 232 240); }

/* ============================================
   FORMS
   ============================================ */

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border-radius: 0.625rem;
  border: 1px solid rgb(226 232 240);
  background: white;
  font-size: 0.9375rem;
  color: rgb(15 23 42);
  transition: all 0.15s ease;
  outline: none;
  font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: rgb(129 140 248);
  box-shadow: 0 0 0 3px rgb(99 102 241 / 0.1);
}

.dark .form-input, .dark .form-select, .dark .form-textarea {
  background: rgb(15 23 42);
  border-color: rgb(51 65 85);
  color: rgb(226 232 240);
}

.dark .form-input:focus, .dark .form-select:focus, .dark .form-textarea:focus {
  border-color: rgb(129 140 248);
  box-shadow: 0 0 0 3px rgb(99 102 241 / 0.15);
}

.form-input::placeholder, .form-textarea::placeholder { color: rgb(148 163 184); }

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(51 65 85);
  margin-bottom: 0.375rem;
}

.dark .form-label { color: rgb(203 213 225); }

.form-checkbox {
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 0.375rem;
  border: 1.5px solid rgb(203 213 225);
  accent-color: rgb(99 102 241);
  cursor: pointer;
}

.dark .form-checkbox { border-color: rgb(71 85 105); }

/* ============================================
   BADGES
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.badge-sick { background: rgb(244 63 94 / 0.1); color: rgb(244 63 94); border: 1px solid rgb(244 63 94 / 0.2); }
.badge-vacation { background: rgb(16 185 129 / 0.1); color: rgb(16 185 129); border: 1px solid rgb(16 185 129 / 0.2); }
.badge-nopay { background: rgb(245 158 11 / 0.1); color: rgb(245 158 11); border: 1px solid rgb(245 158 11 / 0.2); }

.badge-pending { background: rgb(245 158 11 / 0.1); color: rgb(180 83 9); border: 1px solid rgb(245 158 11 / 0.2); }
.dark .badge-pending { color: rgb(251 191 36); }

.badge-approved { background: rgb(16 185 129 / 0.1); color: rgb(4 120 87); border: 1px solid rgb(16 185 129 / 0.2); }
.dark .badge-approved { color: rgb(52 211 153); }

.badge-rejected { background: rgb(244 63 94 / 0.1); color: rgb(190 18 60); border: 1px solid rgb(244 63 94 / 0.2); }
.dark .badge-rejected { color: rgb(251 113 133); }

.badge-info { background: rgb(99 102 241 / 0.1); color: rgb(67 56 202); border: 1px solid rgb(99 102 241 / 0.2); }
.dark .badge-info { color: rgb(165 180 252); }

.badge-manager { background: rgb(6 182 212 / 0.1); color: rgb(14 116 144); border: 1px solid rgb(6 182 212 / 0.2); }
.dark .badge-manager { color: rgb(103 232 249); }

.badge-hr { background: rgb(168 85 247 / 0.1); color: rgb(126 34 206); border: 1px solid rgb(168 85 247 / 0.2); }
.dark .badge-hr { color: rgb(216 180 254); }

.badge-success { background: rgb(16 185 129 / 0.1); color: rgb(4 120 87); border: 1px solid rgb(16 185 129 / 0.2); }
.dark .badge-success { color: rgb(52 211 153); }

.badge-secondary { background: rgb(100 116 139 / 0.1); color: rgb(71 85 105); border: 1px solid rgb(100 116 139 / 0.2); }
.dark .badge-secondary { color: rgb(148 163 184); }

/* ============================================
   TABLES
   ============================================ */

.table-modern {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-modern thead th {
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgb(100 116 139);
  background: rgb(248 250 252);
  border-bottom: 1px solid rgb(226 232 240);
  text-align: left;
  white-space: nowrap;
}

.dark .table-modern thead th {
  color: rgb(148 163 184);
  background: rgb(15 23 42 / 0.5);
  border-bottom-color: rgb(30 41 59);
}

.table-modern tbody td {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid rgb(241 245 249);
  vertical-align: middle;
}

.dark .table-modern tbody td { border-bottom-color: rgb(30 41 59 / 0.5); }

.table-modern tbody tr { transition: background 0.1s ease; }
.table-modern tbody tr:hover { background: rgb(248 250 252); }
.dark .table-modern tbody tr:hover { background: rgb(30 41 59 / 0.3); }
.table-modern tbody tr:last-child td { border-bottom: none; }

/* ============================================
   MODALS (Alpine.js based)
   ============================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgb(0 0 0 / 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-panel {
  background: white;
  border-radius: 1.25rem;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  max-width: 32rem;
  width: 100%;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.modal-panel.modal-lg { max-width: 48rem; }

.dark .modal-panel {
  background: rgb(15 23 42);
  border: 1px solid rgb(30 41 59);
}

/* ============================================
   FULLCALENDAR 6 OVERRIDES
   ============================================ */

.fc {
  --fc-border-color: rgb(226 232 240);
  --fc-page-bg-color: transparent;
  --fc-neutral-bg-color: rgb(248 250 252);
  --fc-today-bg-color: rgb(238 242 255 / 0.5);
  --fc-event-border-color: transparent;
  font-family: 'Inter', system-ui, sans-serif !important;
}

.dark .fc {
  --fc-border-color: rgb(30 41 59);
  --fc-neutral-bg-color: rgb(15 23 42);
  --fc-today-bg-color: rgb(99 102 241 / 0.05);
}

.fc .fc-button {
  background: transparent !important;
  border: 1px solid rgb(226 232 240) !important;
  color: rgb(71 85 105) !important;
  padding: 0.375rem 0.75rem !important;
  border-radius: 0.5rem !important;
  font-weight: 500 !important;
  font-size: 0.875rem !important;
  transition: all 0.15s ease !important;
  box-shadow: none !important;
}

.dark .fc .fc-button { border-color: rgb(51 65 85) !important; color: rgb(148 163 184) !important; }
.fc .fc-button:hover { background: rgb(241 245 249) !important; color: rgb(15 23 42) !important; }
.dark .fc .fc-button:hover { background: rgb(30 41 59) !important; color: rgb(226 232 240) !important; }

.fc .fc-button-active {
  background: rgb(99 102 241) !important;
  border-color: rgb(99 102 241) !important;
  color: white !important;
}

.fc .fc-toolbar-title { font-size: 1.25rem !important; font-weight: 700 !important; }
.dark .fc .fc-toolbar-title { color: rgb(226 232 240) !important; }

.fc .fc-col-header-cell {
  padding: 0.5rem 0 !important;
  font-weight: 600 !important;
  font-size: 0.8125rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}

.dark .fc .fc-col-header-cell-cushion { color: rgb(148 163 184) !important; }

.fc .fc-daygrid-day-number { font-weight: 500 !important; font-size: 0.875rem !important; padding: 0.5rem !important; }
.dark .fc .fc-daygrid-day-number { color: rgb(203 213 225) !important; }

.fc .fc-event {
  border-radius: 0.375rem !important;
  padding: 0.125rem 0.5rem !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  border: none !important;
}

.fc .fc-daygrid-day.fc-day-today { border-radius: 0.5rem; }

/* ============================================
   PROGRESS BARS
   ============================================ */

.progress-bar { height: 0.5rem; border-radius: 9999px; background: rgb(241 245 249); overflow: hidden; }
.dark .progress-bar { background: rgb(30 41 59); }
.progress-fill { height: 100%; border-radius: 9999px; transition: width 0.5s ease; }

/* ============================================
   CHART.JS
   ============================================ */

.chart-container { position: relative; height: 380px; }
.chart-container-sm { position: relative; height: 300px; }

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, rgb(241 245 249) 25%, rgb(248 250 252) 50%, rgb(241 245 249) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 0.5rem;
}

.dark .skeleton {
  background: linear-gradient(90deg, rgb(30 41 59) 25%, rgb(51 65 85) 50%, rgb(30 41 59) 75%);
  background-size: 200% 100%;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  main { padding-bottom: 5rem !important; }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid rgb(99 102 241);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

/* ============================================
   PRINT
   ============================================ */

@media print {
  nav, footer, .bottom-nav, .btn, button { display: none !important; }
  main { max-width: 100% !important; padding: 0 !important; }
  .card { break-inside: avoid; border: 1px solid #ddd !important; box-shadow: none !important; }
}
