.ess-page {
  min-height: calc(100vh - 58px);
  padding: 20px;
  background: #f4f7f8;
}

.ess-header,
.ess-panel,
.ess-kpis > div {
  background: #fff;
  border: 1px solid #dfe8ec;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(28, 45, 56, .05);
}

.ess-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  margin-bottom: 14px;
}

.ess-header > * {
  min-width: 0;
}

.ess-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.ess-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ess-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ess-avatar {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #e7f5f2;
  color: #197465;
  font-size: 22px;
  font-weight: 900;
}

.ess-header h2,
.ess-panel h3 {
  margin: 0;
  color: #22313f;
  font-weight: 900;
}

.ess-header h2 {
  font-size: 24px;
  overflow-wrap: anywhere;
}

.ess-header p {
  margin: 4px 0 0;
  color: #647681;
  font-size: 13px;
}

.ess-error {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #f1b6b6;
  border-radius: 8px;
  background: #fff1f1;
  color: #a11f1f;
  font-weight: 800;
}

.ess-kpis,
.ess-grid,
.ess-mini-grid {
  display: grid;
  gap: 12px;
}

.ess-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.ess-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}

.ess-kpis > div,
.ess-panel {
  padding: 14px;
}

.ess-panel {
  overflow: hidden;
}

.ess-kpis span {
  display: block;
  color: #647681;
  font-size: 13px;
}

.ess-kpis strong {
  display: block;
  margin-top: 5px;
  color: #22313f;
  font-size: 24px;
}

.ess-panel-head {
  margin-bottom: 12px;
}

.ess-panel h3 {
  font-size: 17px;
}

.ess-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ess-fact,
.ess-mini-card,
.ess-payslip-card {
  border: 1px solid #e0e9ed;
  border-radius: 8px;
  padding: 10px;
  background: #f8fbfc;
}

.ess-fact span,
.ess-mini-card span {
  display: block;
  color: #6b7c86;
  font-size: 12px;
}

.ess-fact strong,
.ess-mini-card strong {
  display: block;
  margin-top: 4px;
  color: #26333b;
  font-size: 14px;
}

.ess-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.ess-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #d3dfe4;
  border-radius: 8px;
  background: #fff;
  color: #40545e;
  font-weight: 900;
}

.ess-tabs button.active {
  border-color: #168c78;
  background: #e7f5f2;
  color: #126b5c;
}

.ess-tab-panel {
  display: none;
}

.ess-tab-panel.active {
  display: block;
}

.ess-mini-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.ess-payslips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.ess-payslip-card h4 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.ess-request-form {
  display: grid;
  gap: 12px;
}

.ess-request-form label span {
  display: block;
  margin-bottom: 5px;
  color: #40545e;
  font-size: 13px;
  font-weight: 900;
}

.ess-mobile-status {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.ess-mobile-status.ok {
  border: 1px solid #b9e5d8;
  background: #edf9f5;
  color: #197465;
}

.ess-mobile-status.blocked {
  border: 1px solid #f1c8c8;
  background: #fff1f1;
  color: #a11f1f;
}

.ess-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 8px;
  background: #e7f5f2;
  color: #197465;
  font-size: 12px;
  font-weight: 800;
}

.ess-chip.warn {
  background: #fff3d6;
  color: #9a6700;
}

.ess-chip.danger {
  background: #fdecec;
  color: #b42318;
}

#essRequestModal .modal-dialog,
#mobilePunchModal .modal-dialog {
  max-width: 520px;
  margin-inline: auto;
}

#essRequestModal .modal-content,
#mobilePunchModal .modal-content {
  border-radius: 8px;
  overflow: hidden;
}

#essRequestModal .modal-header,
#mobilePunchModal .modal-header {
  align-items: center;
  padding: 14px 16px;
  border-bottom-color: #e0e9ed;
  background: #f8fbfc;
}

#essRequestModal .modal-title,
#mobilePunchModal .modal-title {
  color: #22313f;
  font-size: 16px;
  font-weight: 900;
}

#essRequestModal .modal-body,
#mobilePunchModal .modal-body {
  padding: 14px 16px;
}

#essRequestModal .modal-footer,
#mobilePunchModal .modal-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 16px;
  border-top-color: #e0e9ed;
}

#essRequestModal .modal-footer > *,
#mobilePunchModal .modal-footer > * {
  margin: 0;
  justify-content: center;
}

#essRequestModal .ess-request-form,
#mobilePunchModal .ess-request-form {
  gap: 10px;
}

#essRequestModal .form-control,
#essRequestModal .form-select,
#mobilePunchModal .form-control,
#mobilePunchModal .form-select {
  min-height: 40px;
}

#essRequestModal textarea.form-control,
#mobilePunchModal textarea.form-control {
  min-height: 82px;
  resize: vertical;
}

.ess-panel .table-responsive {
  border: 1px solid #e0e9ed;
  border-radius: 8px;
}

.ess-panel table {
  min-width: 680px;
}

.ess-panel table th {
  color: #40545e;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.ess-panel table td {
  color: #26333b;
  font-size: 13px;
  vertical-align: middle;
}

@media (max-width: 900px) {
  .ess-header,
  .ess-identity {
    align-items: stretch;
  }

  .ess-header,
  .ess-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .ess-identity {
    width: 100%;
  }

  .ess-actions {
    justify-content: stretch;
    width: 100%;
  }

  .ess-actions .btn {
    justify-content: center;
    flex: 1 1 145px;
  }

  .ess-kpis,
  .ess-facts {
    grid-template-columns: 1fr;
  }

  .ess-grid {
    gap: 10px;
  }
}

@media (max-width: 600px) {
  .ess-page {
    padding: 10px;
  }

  .ess-avatar {
    width: 48px;
    height: 48px;
  }

  .ess-header h2 {
    font-size: 20px;
  }

  .ess-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .ess-tabs button {
    white-space: nowrap;
  }

  .ess-panel {
    padding: 12px;
  }

  .ess-kpis {
    gap: 8px;
  }

  .ess-kpis > div {
    padding: 12px;
  }

  .ess-kpis strong {
    font-size: 20px;
  }

  .ess-actions .btn span {
    font-size: 13px;
  }

  .ess-panel table {
    min-width: 620px;
  }

  #essRequestModal .modal-dialog,
  #mobilePunchModal .modal-dialog {
    width: calc(100vw - 20px);
    max-width: none;
    margin: 10px auto;
  }

  #essRequestModal .modal-body,
  #mobilePunchModal .modal-body {
    max-height: calc(100vh - 150px);
    overflow-y: auto;
  }

  #essRequestModal .modal-footer,
  #mobilePunchModal .modal-footer {
    grid-template-columns: 1fr;
  }
}
