/* HRMS Component Classes - Tailwind-compatible (use with Tailwind CDN or build) */
/* Primary: #6B46C1 */

.hr-sidebar {
  width: 16rem;
  background-color: #fff;
  border-right: 1px solid #e5e7eb;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 40;
}
.dark .hr-sidebar {
  background-color: #1f2937;
  border-color: #374151;
}

/* Sidebar nav scrollbar - match design system */
.hr-sidebar [data-testid="sidebar-nav"] {
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}
.dark .hr-sidebar [data-testid="sidebar-nav"] {
  scrollbar-color: #4b5563 transparent;
}
.hr-sidebar [data-testid="sidebar-nav"]::-webkit-scrollbar {
  width: 6px;
}
.hr-sidebar [data-testid="sidebar-nav"]::-webkit-scrollbar-track {
  background: transparent;
}
.hr-sidebar [data-testid="sidebar-nav"]::-webkit-scrollbar-thumb {
  background-color: #d1d5db;
  border-radius: 3px;
}
.hr-sidebar [data-testid="sidebar-nav"]::-webkit-scrollbar-thumb:hover {
  background-color: #9ca3af;
}
.dark .hr-sidebar [data-testid="sidebar-nav"]::-webkit-scrollbar-thumb {
  background-color: #4b5563;
}
.dark .hr-sidebar [data-testid="sidebar-nav"]::-webkit-scrollbar-thumb:hover {
  background-color: #6b7280;
}

.hr-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  color: #4b5563;
  transition: all 0.2s;
}
.dark .hr-nav-item {
  color: #9ca3af;
}
.hr-nav-item:hover {
  background-color: #f3f4f6;
}
.dark .hr-nav-item:hover {
  background-color: #374151;
}
.hr-nav-item.active {
  background-color: #6B46C1;
  color: white;
}
.hr-nav-item.active:hover {
  background-color: #5B21B6;
}

/* Submenus: collapsed by default, expand only when .expand is present */
.hr-nav-group .hr-submenu {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.2s ease;
}
.hr-nav-group.expand .hr-submenu {
  grid-template-rows: 1fr;
}
.hr-nav-group .hr-submenu > .hr-submenu-inner {
  overflow: hidden;
  min-height: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.hr-nav-group.expand .hr-nav-item .fa-angle-down {
  transform: rotate(180deg);
}
.hr-nav-subitem {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
  font-size: 0.875rem;
}
.hr-nav-group button {
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
}

.hr-card {
  background-color: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  border: 1px solid #e5e7eb;
}
.dark .hr-card {
  background-color: #1f2937;
  border-color: #374151;
}

.hr-card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  background-color: #f9fafb;
}
.dark .hr-card-header {
  border-color: #374151;
  background-color: #111827;
}

.hr-card-title {
  font-weight: 600;
  color: #111827;
  margin: 0;
}
.dark .hr-card-title {
  color: white;
}

.hr-card-body {
  padding: 1rem 1.5rem;
}

.hr-dl { display: grid; gap: 0.5rem 1rem; }
.hr-dl > div { display: grid; grid-template-columns: 180px 1fr; gap: 0.5rem; align-items: start; }
.hr-dl dt { font-weight: 500; color: #6b7280; }
.dark .hr-dl dt { color: #9ca3af; }
.hr-dl dd { margin: 0; color: #111827; }
.dark .hr-dl dd { color: #f3f4f6; }

.hr-btn { text-decoration: none; }
.hr-btn:hover { text-decoration: none; }

.hr-table { width: 100%; font-size: 0.875rem; }
.hr-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: #f9fafb;
}
.dark .hr-table th {
  color: #9ca3af;
  background-color: #111827;
}
.hr-table td {
  padding: 0.75rem 1rem;
  border-top: 1px solid #e5e7eb;
  color: #111827;
}
.dark .hr-table td {
  border-color: #374151;
  color: #f3f4f6;
}
.hr-table tbody tr:hover {
  background-color: #f9fafb;
}
.dark .hr-table tbody tr:hover {
  background-color: rgba(55, 65, 81, 0.5);
}

.hr-badge {
  display: inline-flex;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.hr-badge-success {
  background-color: #d1fae5;
  color: #065f46;
}
.dark .hr-badge-success {
  background-color: rgba(6, 95, 70, 0.3);
  color: #6ee7b7;
}
.hr-badge-warning {
  background-color: #fef3c7;
  color: #92400e;
}
.dark .hr-badge-warning {
  background-color: rgba(146, 64, 14, 0.3);
  color: #fcd34d;
}
.hr-badge-info {
  background-color: #dbeafe;
  color: #1e40af;
}
.dark .hr-badge-info {
  background-color: rgba(30, 64, 175, 0.3);
  color: #93c5fd;
}
.hr-badge-danger {
  background-color: #fee2e2;
  color: #991b1b;
}
.dark .hr-badge-danger {
  background-color: rgba(153, 27, 27, 0.3);
  color: #fca5a5;
}

.hr-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: #6B46C1;
  color: white;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s;
}
.hr-btn-primary:hover {
  background-color: #5B21B6;
}

.hr-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  color: #374151;
  transition: all 0.2s;
}
.dark .hr-btn-secondary {
  border-color: #4b5563;
  color: #d1d5db;
}
.hr-btn-secondary:hover {
  background-color: #f9fafb;
}
.dark .hr-btn-secondary:hover {
  background-color: #374151;
}

.hr-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background-color: #fff;
  color: #111827;
}
.dark .hr-input {
  border-color: #4b5563;
  background-color: #1f2937;
  color: #f3f4f6;
}
.hr-input:focus {
  outline: none;
  ring: 2px;
  border-color: #6B46C1;
  box-shadow: 0 0 0 2px rgba(107, 70, 193, 0.2);
}

.hr-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.25rem;
}
.dark .hr-label {
  color: #d1d5db;
}

.hr-main-content {
  flex: 1;
  min-width: 0;
  margin-left: 16rem;
  padding-top: 4rem;
  min-height: 100vh;
  background-color: #f9fafb;
}
.dark .hr-main-content {
  background-color: #111827;
}

.hr-page-container {
  width: 100%;
  min-width: 0;
  padding: 1.5rem;
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
}

/* Role chip (employee login) - selected state */
.role-chip:has(input:checked) {
  border-color: #6B46C1;
  background-color: rgba(107, 70, 193, 0.08);
  box-shadow: 0 0 0 2px rgba(107, 70, 193, 0.2);
}
.dark .role-chip:has(input:checked) {
  background-color: rgba(107, 70, 193, 0.15);
}

/* Bootstrap compatibility for employee panel partials (job_card_details, notice_list) */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.5rem 0.75rem; border-top: 1px solid #e5e7eb; text-align: left; }
.table thead th { font-weight: 600; background: #f9fafb; }
.table-bordered th, .table-bordered td { border: 1px solid #e5e7eb; }
.hr-table td.active { background-color: #f3f4f6; }
.dark .hr-table td.active { background-color: rgba(55, 65, 81, 0.5); }
.hr-table td.bg-primary { background-color: #6B46C1; color: white; }
.hr-table td.alert-info { background-color: #dbeafe; color: #1e40af; }
.hr-table td.alert-danger { background-color: #fee2e2; color: #991b1b; }
.table-striped tbody tr:nth-of-type(odd) { background: #f9fafb; }
.table-responsive { overflow-x: auto; }
.alert { padding: 0.75rem 1rem; margin-bottom: 0.5rem; border-radius: 0.5rem; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-info { background: #dbeafe; color: #1e40af; }
.bg-primary { background: #6B46C1; color: white; }
.pull-left { float: left; }
.btn-info { display: inline-block; padding: 0.5rem 1rem; background: #0ea5e9; color: white; border-radius: 0.5rem; }
.modal { display: none; position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0.5); align-items: center; justify-content: center; }
.modal.show { display: flex; }
.modal-dialog { background: white; border-radius: 0.5rem; max-width: 90vw; max-height: 90vh; overflow: auto; }
.modal-header { padding: 1rem 1.5rem; border-bottom: 1px solid #e5e7eb; display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 1rem 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid #e5e7eb; }
.close { background: none; border: none; font-size: 1.5rem; cursor: pointer; }

/* Print styles */
@media print {
  .hr-sidebar,
  .hr-main-content + *,
  [class*="sidebar"],
  [class*="header"],
  button,
  .no-print,
  nav {
    display: none !important;
  }
  .hr-main-content {
    margin-left: 0 !important;
    padding-top: 0 !important;
  }
  .hr-page-container {
    max-width: none !important;
  }
  body {
    background: white !important;
  }
}
