/* ==========================================================================
   AIRH Employee Detail Page — Futuristic Neumorphism Design
   ========================================================================== */

/* ---------------------------------------------------------------------------
   Page Layout
   --------------------------------------------------------------------------- */
.employee-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  max-width: 900px;
}

/* ---------------------------------------------------------------------------
   Profile Header — Neumorphic raised card
   --------------------------------------------------------------------------- */
.employee-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-6);
  padding: var(--space-6) var(--space-8);
  background: var(--color-bg-primary);
  border: none;
  box-shadow: var(--neu-raised);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}

.employee-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-accent), #6366f1, var(--color-accent));
  background-size: 200% 100%;
}

.employee-header__avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--color-accent-subtle), rgba(35, 131, 226, 0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-accent);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  box-shadow: var(--neu-raised-sm);
}

.employee-header__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.employee-header__avatar-edit {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.45);
  color: #ffffff;
  opacity: 0;
  cursor: pointer;
  transition: opacity 150ms ease;
  border-radius: inherit;
}

.employee-header__avatar:hover .employee-header__avatar-edit {
  opacity: 1;
}

.employee-header__info {
  flex: 1;
  min-width: 0;
}

.employee-header__name {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: var(--tracking-tight);
  line-height: 1.2;
}

.employee-header__role {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.employee-header__meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-3);
  flex-wrap: wrap;
}

.employee-header__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}

.employee-header__meta-icon {
  width: 13px;
  height: 13px;
  opacity: 0.5;
}

.employee-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   Info Grid — Clean two-column layout with subtle separators
   --------------------------------------------------------------------------- */
.employee-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}

.employee-info-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid rgba(var(--color-border-light-rgb, 0, 0, 0), 0.06);
  transition: background-color 100ms ease;
}

.employee-info-item:hover {
  background-color: var(--color-bg-hover);
}

.employee-info-item:nth-child(odd) {
  border-right: 1px solid rgba(var(--color-border-light-rgb, 0, 0, 0), 0.06);
}

.employee-info-item:nth-last-child(-n+2) {
  border-bottom: none;
}

.employee-info-item__label {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

.employee-info-item__value {
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  font-weight: 500;
}

.employee-info-item__value--empty {
  color: var(--color-text-placeholder);
  font-style: italic;
  font-weight: 400;
  font-size: var(--text-xs);
}

/* ---------------------------------------------------------------------------
   Section Cards — Neumorphic raised blocks
   --------------------------------------------------------------------------- */
.employee-section {
  background: var(--color-bg-primary);
  border: none;
  box-shadow: var(--neu-raised);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: box-shadow 200ms ease;
}

.employee-section:hover {
  box-shadow: var(--neu-raised-lg);
}

.employee-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid rgba(var(--color-border-light-rgb, 0, 0, 0), 0.06);
}

.employee-section__title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.employee-section__title::before {
  content: '';
  width: 3px;
  height: 14px;
  background: linear-gradient(180deg, var(--color-accent), #6366f1);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.employee-section__body {
  padding: 0;
}

.employee-section__body--padded {
  padding: var(--space-5);
}

/* ---------------------------------------------------------------------------
   Documents List — File browser style
   --------------------------------------------------------------------------- */
.employee-doc-list {
  display: flex;
  flex-direction: column;
}

.employee-doc-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid rgba(var(--color-border-light-rgb, 0, 0, 0), 0.06);
  transition: background-color 100ms ease;
  cursor: pointer;
}

.employee-doc-item:last-child {
  border-bottom: none;
}

.employee-doc-item:hover {
  background-color: var(--color-bg-hover);
}

.employee-doc-item__icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-lg);
  background: var(--color-bg-primary);
  box-shadow: var(--neu-inset-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.employee-doc-item__info {
  flex: 1;
  min-width: 0;
}

.employee-doc-item__name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-doc-item__date {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  margin-top: 1px;
}

/* ---------------------------------------------------------------------------
   Contract Timeline
   --------------------------------------------------------------------------- */
.contracts-timeline {
  display: flex;
  flex-direction: column;
  padding: var(--space-4) var(--space-5);
}

.contract-timeline-item {
  display: flex;
  gap: var(--space-4);
  position: relative;
  padding-bottom: var(--space-5);
}

.contract-timeline-item:last-child {
  padding-bottom: 0;
}

.contract-timeline-item::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 14px;
  bottom: -6px;
  width: 1px;
  background-color: rgba(var(--color-border-light-rgb, 0, 0, 0), 0.08);
}

.contract-timeline-item:last-child::before {
  display: none;
}

.contract-timeline-item__dot {
  width: 11px;
  height: 11px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-border);
  background: var(--color-bg-primary);
  box-shadow: var(--neu-raised-sm);
  flex-shrink: 0;
  margin-top: 3px;
  z-index: 1;
}

.contract-timeline-item__dot--active {
  border-color: var(--color-success);
  background-color: var(--color-success);
  box-shadow: 0 0 0 3px rgba(var(--color-success-rgb, 34, 197, 94), 0.15), var(--neu-raised-sm);
}

.contract-timeline-item__dot--expired {
  border-color: var(--color-text-tertiary);
  background-color: var(--color-text-tertiary);
}

.contract-card {
  flex: 1;
  background: var(--color-bg-primary);
  border: none;
  box-shadow: var(--neu-flat);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  min-width: 0;
}

.contract-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.contract-card__type {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
}

.contract-card__ref {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
}

.contract-card__dates {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.contract-card__dates-separator {
  color: var(--color-text-placeholder);
}

.contract-card__details {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.contract-card__detail {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.contract-card__detail-icon {
  width: 12px;
  height: 12px;
  opacity: 0.5;
}

/* ---------------------------------------------------------------------------
   Leave Balance Cards
   --------------------------------------------------------------------------- */
.leaves__balances {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-3);
}

.leave-balance {
  background: var(--color-bg-primary);
  border: none;
  box-shadow: var(--neu-raised-sm);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.leave-balance__type {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.leave-balance__days {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.leave-balance__total {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}

.leave-balance__bar {
  height: 4px;
  background: var(--color-bg-primary);
  box-shadow: var(--neu-inset-sm);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: var(--space-1);
}

.leave-balance__bar-fill {
  height: 100%;
  background-color: var(--color-accent);
  border-radius: var(--radius-full);
  transition: width 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.leave-balance__bar-fill--low {
  background-color: var(--color-warning);
}

.leave-balance__bar-fill--critical {
  background-color: var(--color-error);
}

/* ---------------------------------------------------------------------------
   Habilitation Cards
   --------------------------------------------------------------------------- */
.habilitations__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
}

.habilitation-card {
  background: var(--color-bg-primary);
  border: none;
  box-shadow: var(--neu-flat);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  transition: box-shadow 150ms ease;
}

.habilitation-card:hover {
  box-shadow: var(--neu-raised-sm);
}

.habilitation-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.habilitation-card__name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
}

.habilitation-card__employee {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  margin-top: 2px;
}

.habilitation-validity {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.habilitation-validity__bar-wrapper {
  height: 4px;
  background: var(--color-bg-primary);
  box-shadow: var(--neu-inset-sm);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.habilitation-validity__bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.habilitation-validity__bar--valid {
  background-color: var(--color-success);
}

.habilitation-validity__bar--warning {
  background-color: var(--color-warning);
}

.habilitation-validity__bar--expired {
  background-color: var(--color-error);
}

.habilitation-validity__info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}

.habilitation-validity__remaining {
  font-weight: 600;
}

.habilitation-validity__remaining--warning {
  color: var(--color-warning-text);
}

.habilitation-validity__remaining--expired {
  color: var(--color-error-text);
}

/* ---------------------------------------------------------------------------
   EPI Grid
   --------------------------------------------------------------------------- */
.epi__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
}

.epi-card {
  background: var(--color-bg-primary);
  border: none;
  box-shadow: var(--neu-flat);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  transition: box-shadow 150ms ease;
}

.epi-card:hover {
  box-shadow: var(--neu-raised-sm);
}

.epi-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid rgba(var(--color-border-light-rgb, 0, 0, 0), 0.06);
}

.epi-card__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-lg);
  background: var(--color-bg-primary);
  box-shadow: var(--neu-inset-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  flex-shrink: 0;
}

.epi-card__icon svg {
  width: 18px;
  height: 18px;
}

.epi-card__info {
  flex: 1;
  min-width: 0;
}

.epi-card__name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
}

.epi-card__type {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  margin-top: 1px;
}

.epi-card__assignment {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.epi-assignment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.epi-assignment-row__label {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}

.epi-assignment-row__value {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-primary);
}

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */
@media (max-width: 639px) {
  .employee-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-5);
  }

  .employee-header__avatar {
    width: 64px;
    height: 64px;
  }

  .employee-header__meta {
    justify-content: center;
  }

  .employee-header__actions {
    width: 100%;
    justify-content: center;
  }

  .employee-info-grid {
    grid-template-columns: 1fr;
  }

  .employee-info-item {
    border-right: none !important;
  }

  .employee-section__header {
    padding: var(--space-3) var(--space-4);
  }

  .habilitations__grid,
  .epi__grid {
    grid-template-columns: 1fr;
    padding: var(--space-3) var(--space-4);
  }

  .leaves__balances {
    grid-template-columns: repeat(2, 1fr);
  }

  .contracts-timeline {
    padding: var(--space-3) var(--space-4);
  }
}
