/* Roster-Specific Styles for SF Employee Roster */

/* Stats Grid cards */
.stats-grid.employee-stats .stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.stats-grid.employee-stats .stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 20px -8px var(--shadow-color), 0 4px 12px -2px var(--shadow-color);
  border-color: light-dark(rgba(99, 102, 241, 0.25), rgba(255, 255, 255, 0.15));
}

.stats-grid.employee-stats .stat-icon {
  background: light-dark(rgba(99, 102, 241, 0.08), rgba(99, 102, 241, 0.15));
  color: var(--primary);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stats-grid.employee-stats .stat-card p {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.stats-grid.employee-stats .stat-card strong {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
}

.stats-grid.employee-stats .stat-card span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

/* Avatar Badge */
.employee-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  margin-right: 12px;
  vertical-align: middle;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 4px 8px var(--primary-glow);
  user-select: none;
  flex-shrink: 0;
}

/* Row elements grouping */
.employee-name-cell {
  display: flex;
  align-items: center;
}

.employee-name-info {
  display: flex;
  flex-direction: column;
}

/* Status Pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-pill.status-active {
  color: light-dark(#166534, #4ade80);
  background: light-dark(#f0fdf4, rgba(74, 222, 128, 0.1));
  border-color: light-dark(#bbf7d0, rgba(74, 222, 128, 0.2));
}

.status-pill.status-probation {
  color: light-dark(#1e40af, #60a5fa);
  background: light-dark(#eff6ff, rgba(96, 165, 250, 0.1));
  border-color: light-dark(#dbeafe, rgba(96, 165, 250, 0.2));
}

.status-pill.status-onboarding {
  color: light-dark(#9a3412, #fb923c);
  background: light-dark(#fff7ed, rgba(251, 146, 60, 0.1));
  border-color: light-dark(#ffedd5, rgba(251, 146, 60, 0.2));
}

.status-pill.status-suspended {
  color: light-dark(#6b21a8, #c084fc);
  background: light-dark(#faf5ff, rgba(192, 132, 252, 0.1));
  border-color: light-dark(#f3e8ff, rgba(192, 132, 252, 0.2));
}

.status-pill.status-departed {
  color: light-dark(#374151, #9ca3af);
  background: light-dark(#f3f4f6, rgba(156, 163, 175, 0.1));
  border-color: light-dark(#e5e7eb, rgba(156, 163, 175, 0.2));
}

.status-pill.status-blacklist {
  color: light-dark(#991b1b, #f87171);
  background: light-dark(#fef2f2, rgba(248, 113, 113, 0.1));
  border-color: light-dark(#fee2e2, rgba(248, 113, 113, 0.2));
}

/* Flag Indicators */
.employee-flag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin: 0 4px 4px 0;
  padding: 0 8px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
}

.employee-flag.on {
  color: light-dark(#00695c, #2dd4bf);
  background: light-dark(#e0f2f1, rgba(45, 212, 191, 0.1));
  border-color: light-dark(#b2dfdb, rgba(45, 212, 191, 0.2));
}

.employee-flag.on::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 5px;
}

.employee-flag.off {
  color: light-dark(#ad1457, #fb7185);
  background: light-dark(#fce4ec, rgba(251, 113, 133, 0.1));
  border-color: light-dark(#f8bbd0, rgba(251, 113, 133, 0.2));
}

.employee-flag.off::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rose);
  margin-right: 5px;
}

/* Toolbar & Grid Layout */
.employee-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
  background: light-dark(rgba(255, 255, 255, 0.5), rgba(15, 23, 42, 0.2));
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  margin-bottom: 20px;
  backdrop-filter: var(--backdrop-blur);
}

.employee-toolbar input[type="search"] {
  grid-column: span 2;
  width: 100%;
}

.employee-toolbar label {
  width: 100%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.employee-toolbar select,
.employee-toolbar input {
  width: 100%;
  min-height: 38px;
}

.employee-toolbar button,
.employee-toolbar a.ghost-btn {
  min-height: 38px;
  margin-top: auto;
}

@media (max-width: 900px) {
  .employee-toolbar input[type="search"] {
    grid-column: span 1;
  }
}

/* Department grouping */
.employee-department-groups {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.employee-department-tree {
  gap: 10px;
}

.employee-department-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  overflow: hidden;
}

.employee-department-group summary {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) auto auto auto;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  cursor: pointer;
  list-style: none;
  border-bottom: 1px solid transparent;
}

.employee-department-group.level-2,
.employee-department-group.level-3,
.employee-department-group.level-4 {
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.employee-department-group.level-2 {
  margin-left: 18px;
}

.employee-department-group.level-3 {
  margin-left: 36px;
}

.employee-department-group.level-4 {
  margin-left: 54px;
}

.employee-department-group summary::-webkit-details-marker {
  display: none;
}

.employee-department-group summary::before {
  content: ">";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transform: rotate(0deg);
  transition: var(--transition-fast);
  grid-column: 1;
}

.employee-department-group[open] summary {
  border-bottom-color: var(--line);
}

.employee-department-group[open] summary::before {
  transform: rotate(90deg);
}

.employee-department-title {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  font-weight: 800;
  color: var(--ink);
  grid-column: 2;
}

.employee-department-count,
.employee-department-meta,
.employee-department-direct {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.employee-department-direct {
  color: var(--primary);
}

.employee-department-children {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px 12px;
}

.employee-department-group .employee-table {
  border: 0;
  border-radius: 0;
  margin: 0;
}

.employee-department-group .employee-table table {
  margin: 0;
}

@media (max-width: 720px) {
  .employee-department-group summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 58px;
  }

  .employee-department-meta,
  .employee-department-direct {
    grid-column: 2 / -1;
  }

  .employee-department-group.level-2,
  .employee-department-group.level-3,
  .employee-department-group.level-4 {
    margin-left: 10px;
  }
}

/* Table Transitions */
.employee-table table tbody tr {
  transition: var(--transition-fast);
}

.employee-table table tbody tr:hover {
  background-color: light-dark(rgba(99, 102, 241, 0.02), rgba(255, 255, 255, 0.02)) !important;
}

/* Detail Profile Hero banner card */
.employee-profile-hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-lg);
  padding: 28px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.15);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.employee-profile-hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -20%;
  width: 100%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
  transform: rotate(30deg);
  pointer-events: none;
}

.profile-hero-left {
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.profile-hero-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 3px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
  user-select: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.profile-hero-details h2 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -0.02em;
}

.profile-hero-details p {
  margin: 0 0 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.profile-hero-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-hero-badges .pill {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
}

.profile-hero-actions {
  display: flex;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.profile-hero-actions .ghost-btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.profile-hero-actions .ghost-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.profile-hero-actions .primary-btn {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.profile-hero-actions .primary-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

/* Tabs switcher for employee profile details */
.profile-tabs {
  display: flex;
  border-bottom: 2px solid var(--line);
  margin-bottom: 20px;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 1px;
}

.profile-tab {
  padding: 10px 18px;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
  user-select: none;
}

.profile-tab:hover {
  color: var(--primary);
}

.profile-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: tabFadeIn 0.25s ease-out;
}

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

/* Grid layout modifications */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.detail-item {
  background: light-dark(rgba(255, 255, 255, 0.4), rgba(15, 23, 42, 0.3));
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s ease;
}

.detail-item:hover {
  border-color: var(--primary);
}

.detail-item span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.detail-item strong {
  font-size: 14px;
  color: var(--ink);
  overflow-wrap: anywhere;
  font-weight: 700;
}

/* Form Styles */
.employee-form-section {
  grid-column: 1 / -1;
  margin-top: 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}

.employee-form-section h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.employee-form-section h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 14px;
  background: var(--primary);
  border-radius: 2px;
}

.employee-form-grid {
  gap: 16px;
}

/* Modern Sliding Switch for Form Toggles */
.toggle-switch {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: light-dark(#fff, rgba(15, 23, 42, 0.4));
  transition: border-color 0.15s ease, background-color 0.15s ease;
  min-height: 40px;
  width: 100%;
}

.toggle-switch:hover {
  border-color: var(--primary);
  background-color: light-dark(#fcfdfe, rgba(255, 255, 255, 0.02));
}

.toggle-switch input {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 36px;
  height: 18px;
  background-color: light-dark(#cbd5e1, #334155);
  border-radius: 18px;
  transition: background-color 0.15s ease;
  flex-shrink: 0;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

.toggle-switch span.label-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

/* Tabular detail list styles (instead of cards) */
.detail-panel {
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.detail-panel h2 {
  margin-top: 0;
  margin-bottom: 18px;
  font-size: 16px;
  color: var(--ink);
  border-left: 4px solid var(--primary);
  padding-left: 10px;
  font-weight: 800;
}

.detail-list-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.detail-list-table tr {
  border-bottom: 1px solid var(--line);
  transition: background-color 0.15s ease;
}

.detail-list-table tr:hover {
  background-color: light-dark(rgba(15,23,42,0.01), rgba(255,255,255,0.01));
}

.detail-list-table tr:last-child {
  border-bottom: 0;
}

.detail-list-table th {
  width: 180px;
  padding: 14px 16px;
  color: var(--muted);
  font-weight: 700;
  text-align: left;
  font-size: 13px;
  background: light-dark(rgba(15,23,42,0.02), rgba(255,255,255,0.02));
  border-right: 1px solid var(--line);
  vertical-align: middle;
}

.detail-list-table td {
  padding: 14px 16px;
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  vertical-align: middle;
}

@media (max-width: 640px) {
  .detail-list-table tr {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--line);
  }
  .detail-list-table th {
    width: 100%;
    background: transparent;
    border-right: 0;
    padding-bottom: 4px;
  }
  .detail-list-table td {
    width: 100%;
    padding-top: 4px;
  }
}

/* Clickable Sort Headers */
.sort-header {
  color: inherit !important;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.sort-header:hover {
  text-decoration: underline;
  opacity: 0.85;
}
