.hr-portal-page {
  display: grid;
  gap: 18px;
}

.hr-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.hr-kicker {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #16a34a;
}

.hr-page-title {
  margin: 0;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #0f172a;
}

.hr-page-subtitle {
  margin: 8px 0 0;
  max-width: 780px;
  font-size: 14px;
  line-height: 1.6;
}

.hr-page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hr-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.hr-kpi-card,
.hr-panel {
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.hr-kpi-card {
  padding: 18px 16px;
}

.hr-kpi-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.hr-kpi-value {
  margin-top: 10px;
  font-size: 34px;
  line-height: 1;
  font-weight: 900;
  color: #0f172a;
}

.hr-kpi-meta {
  margin-top: 10px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

.hr-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.hr-side-column {
  display: grid;
  gap: 16px;
}

.hr-panel .card-body {
  padding: 18px;
}

.hr-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.hr-section-title {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
}

.hr-section-copy {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: #64748b;
}

.hr-calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hr-toolbar-group {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.hr-calendar-month {
  min-width: 170px;
  text-align: right;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.hr-calendar-legend {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.hr-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.hr-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.hr-legend-swatch.is-holiday { background: #dcfce7; border-color: rgba(34, 197, 94, 0.24); }
.hr-legend-swatch.is-absence { background: #dbeafe; border-color: rgba(59, 130, 246, 0.24); }
.hr-legend-swatch.is-today { background: #fef3c7; border-color: rgba(245, 158, 11, 0.24); }

.hr-calendar-shell {
  overflow-x: auto;
  overflow-y: hidden;
}

.hr-calendar-grid {
  min-width: 760px;
}

.hr-calendar-weekdays,
.hr-calendar-cells {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.hr-calendar-weekdays {
  margin-bottom: 10px;
}

.hr-calendar-weekday {
  padding: 0 4px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.hr-calendar-cell {
  min-height: 128px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}

.hr-calendar-cell.is-muted {
  background: rgba(248, 250, 252, 0.9);
  opacity: 0.68;
}

.hr-calendar-cell.is-today {
  border-color: rgba(245, 158, 11, 0.36);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.18);
}

.hr-calendar-cell.is-holiday {
  background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}

.hr-calendar-cell.has-absence {
  border-color: rgba(59, 130, 246, 0.22);
}

.hr-calendar-cell-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hr-calendar-day-number {
  font-size: 15px;
  font-weight: 900;
  color: #0f172a;
}

.hr-calendar-cell-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.hr-calendar-badge,
.hr-calendar-more {
  width: 100%;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 7px 9px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  border: 1px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hr-calendar-badge {
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
}

.hr-calendar-badge.is-holiday {
  background: #dcfce7;
  border-color: rgba(34, 197, 94, 0.22);
  color: #166534;
}

.hr-calendar-badge.is-absence {
  background: #dbeafe;
  border-color: rgba(59, 130, 246, 0.22);
  color: #1d4ed8;
}

.hr-calendar-more {
  background: rgba(148, 163, 184, 0.14);
  color: #475569;
}

.hr-upcoming-list,
.hr-absence-list {
  display: grid;
  gap: 12px;
}

.hr-upcoming-item,
.hr-absence-item,
.hr-team-card {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 16px;
  background: #ffffff;
}

.hr-upcoming-item {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
}

.hr-upcoming-date {
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: 10px 8px;
  display: grid;
  justify-items: center;
  gap: 4px;
}

.hr-upcoming-date-day {
  font-size: 22px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
}

.hr-upcoming-date-month {
  font-size: 11px;
  font-weight: 800;
  color: #475569;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hr-upcoming-copy,
.hr-absence-item,
.hr-team-card {
  min-width: 0;
}

.hr-upcoming-title,
.hr-absence-name,
.hr-team-name {
  font-size: 14px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.hr-upcoming-meta,
.hr-upcoming-tooltip,
.hr-absence-dates,
.hr-absence-reason,
.hr-team-meta,
.hr-team-agency,
.hr-team-presence {
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.hr-upcoming-tooltip {
  margin-top: 6px;
}

.hr-absence-item,
.hr-team-card {
  padding: 12px;
}

.hr-absence-top,
.hr-team-top,
.hr-team-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.hr-absence-pill,
.hr-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.hr-absence-pill.is-vacation,
.hr-status-pill.is-unavailable {
  background: #dbeafe;
  border-color: rgba(59, 130, 246, 0.22);
  color: #1d4ed8;
}

.hr-absence-pill.is-sick {
  background: #fee2e2;
  border-color: rgba(239, 68, 68, 0.22);
  color: #b91c1c;
}

.hr-absence-pill.is-absent {
  background: #fef3c7;
  border-color: rgba(245, 158, 11, 0.22);
  color: #92400e;
}

.hr-status-pill.is-active {
  background: #dcfce7;
  border-color: rgba(34, 197, 94, 0.22);
  color: #166534;
}

.hr-status-pill.is-holiday {
  background: #f0fdf4;
  border-color: rgba(34, 197, 94, 0.22);
  color: #166534;
}

.hr-team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.hr-team-footer {
  margin-top: 10px;
}

.hr-empty-state {
  border: 1px dashed rgba(148, 163, 184, 0.4);
  border-radius: 16px;
  padding: 16px;
  font-size: 13px;
  color: #64748b;
  background: rgba(248, 250, 252, 0.85);
}

.hr-floating-tooltip {
  position: absolute;
  z-index: 10000;
  max-width: 320px;
  display: none;
  padding: 10px 12px;
  border-radius: 12px;
  background: #0f172a;
  color: #ffffff;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
  pointer-events: none;
}

@media (max-width: 1200px) {
  .hr-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hr-main-grid {
    grid-template-columns: 1fr;
  }

  .hr-team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .hr-page-title {
    font-size: 26px;
  }

  .hr-kpi-grid,
  .hr-team-grid {
    grid-template-columns: 1fr;
  }

  .hr-page-actions,
  .hr-calendar-toolbar {
    width: 100%;
  }

  .hr-page-actions .btn,
  .hr-toolbar-group .btn {
    flex: 1 1 auto;
  }

  .hr-calendar-month {
    min-width: 0;
    text-align: left;
  }

  .hr-upcoming-item {
    grid-template-columns: 1fr;
  }
}
